Skip to content

Commit d24686a

Browse files
Zentrikvtjnash
authored andcommitted
fixup! fixup! Workaround llvm/llvm-project#136292
1 parent d6d1024 commit d24686a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/genericmemory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jl_genericmemory_t *_new_genericmemory_(jl_value_t *mtype, size_t nel, int8_t is
5656
{
5757
if (nel == 0) // zero-sized allocation optimization
5858
return (jl_genericmemory_t*)((jl_datatype_t*)mtype)->instance;
59-
size_t nbytes;
59+
size_t nbytes = 0; // initialized to workaround clang sa bug on v20: https://github.com/llvm/llvm-project/issues/136292
6060
int overflow = __builtin_mul_overflow(nel, elsz, &nbytes);
6161
if (isunion) {
6262
// an extra byte for each isbits union memory element, stored at m->ptr + m->length
@@ -152,7 +152,7 @@ JL_DLLEXPORT jl_genericmemory_t *jl_ptr_to_genericmemory(jl_value_t *mtype, void
152152
if (((uintptr_t)data) & ((align > JL_HEAP_ALIGNMENT ? JL_HEAP_ALIGNMENT : align) - 1))
153153
jl_exceptionf(jl_argumenterror_type,
154154
"unsafe_wrap: pointer %p is not properly aligned to %u bytes", data, align);
155-
size_t nbytes = 0; // initialized to workaround clang sa bug: https://github.com/llvm/llvm-project/issues/136292
155+
size_t nbytes = 0; // initialized to workaround clang sa bug on v20: https://github.com/llvm/llvm-project/issues/136292
156156
int overflow = __builtin_mul_overflow(nel, elsz, &nbytes);
157157
if (isunion) {
158158
// an extra byte for each isbits union memory element, stored at m->ptr + m->length

0 commit comments

Comments
 (0)