Skip to content

Commit 4e67f87

Browse files
authored
Fix a warning in codegen when building with Clang (#26318)
The `cursor` variable is an `int` but is compared against the result of `jl_array_len`, which is a `size_t`. This causes Clang to emit a warning. To fix it we can simply cast `cursor` to a `size_t`.
1 parent 3e94518 commit 4e67f87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/codegen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5900,7 +5900,7 @@ static std::unique_ptr<Module> emit_function(
59005900
mallocVisitLine(ctx, props.file, props.line);
59015901
}
59025902
}
5903-
if (cursor + 1 < jl_array_len(stmts) && jl_is_labelnode(jl_array_ptr_ref(stmts, cursor+1)))
5903+
if ((size_t)cursor + 1 < jl_array_len(stmts) && jl_is_labelnode(jl_array_ptr_ref(stmts, cursor+1)))
59045904
come_from_bb[cursor+1] = ctx.builder.GetInsertBlock();
59055905
find_next_stmt(cursor + 1);
59065906
}

0 commit comments

Comments
 (0)