Skip to content

Commit 413e519

Browse files
authored
Merge branch 'JuliaLang:master' into fix-llvm-zero-args
2 parents 051db26 + f7a2f05 commit 413e519

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/codegen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4134,9 +4134,9 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f,
41344134
if (argv[2].constant) {
41354135
if (!jl_is_long(argv[2].constant))
41364136
return false;
4137-
size_t nel = jl_unbox_long(argv[2].constant);
4138-
if (nel < 0)
4139-
return false;
4137+
// Cast to a unsigned size and let `emit_const_len_memorynew`
4138+
// make sure that `nel` fits in a positive signed integer.
4139+
size_t nel = (size_t)jl_unbox_long(argv[2].constant);
41404140
*ret = emit_const_len_memorynew(ctx, typ, nel, inst);
41414141
}
41424142
else {

0 commit comments

Comments
 (0)