Skip to content

Commit 8f010bb

Browse files
committed
Fix array initialization issue where our selector bytes had invalid values
1 parent 5a3f03d commit 8f010bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/array.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline int store_unboxed(jl_value_t *el_type) // jl_isbits
3030
((jl_datatype_t*)el_type)->layout->npointers == 0) || jl_union_isbits(el_type, &fsz, &al);
3131
}
3232

33-
int jl_array_store_unboxed(jl_value_t *el_type)
33+
JL_DLLEXPORT int jl_array_store_unboxed(jl_value_t *el_type)
3434
{
3535
return store_unboxed(el_type);
3636
}
@@ -98,7 +98,7 @@ static jl_array_t *_new_array_(jl_value_t *atype, uint32_t ndims, size_t *dims,
9898
// No allocation or safepoint allowed after this
9999
a->flags.how = 0;
100100
data = (char*)a + doffs;
101-
if (tot > 0 && !isunboxed)
101+
// if ((tot > 0 && !isunboxed) || jl_is_uniontype(jl_tparam0(atype)))
102102
memset(data, 0, tot);
103103
}
104104
else {
@@ -110,7 +110,7 @@ static jl_array_t *_new_array_(jl_value_t *atype, uint32_t ndims, size_t *dims,
110110
// No allocation or safepoint allowed after this
111111
a->flags.how = 2;
112112
jl_gc_track_malloced_array(ptls, a);
113-
if (!isunboxed)
113+
// if (!isunboxed || jl_is_uniontype(jl_tparam0(atype)))
114114
memset(data, 0, tot);
115115
}
116116
a->flags.pooled = tsz <= GC_MAX_SZCLASS;

0 commit comments

Comments
 (0)