Skip to content

Commit b942000

Browse files
committed
updates
1 parent aec45db commit b942000

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/array.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline int store_unboxed(jl_value_t *el_type) // jl_isbits
2727
size_t fsz = 0, al = 0;
2828
return (jl_is_leaf_type(el_type) && jl_is_immutable(el_type) &&
2929
((jl_datatype_t*)el_type)->layout &&
30-
((jl_datatype_t*)el_type)->layout->npointers == 0) || jl_union_isbits(el_type, fsz, al);
30+
((jl_datatype_t*)el_type)->layout->npointers == 0) || jl_union_isbits(el_type, &fsz, &al);
3131
}
3232

3333
int jl_array_store_unboxed(jl_value_t *el_type)
@@ -80,6 +80,7 @@ static jl_array_t *_new_array_(jl_value_t *atype, uint32_t ndims, size_t *dims,
8080
}
8181
jl_value_t *el_type = (jl_value_t*)jl_tparam0(jl_typeof(atype));
8282
if (jl_is_uniontype(el_type)) {
83+
printf("here 3");
8384
// allocate an extra sel byte for each element
8485
tot += nel;
8586
}
@@ -503,6 +504,7 @@ JL_DLLEXPORT jl_value_t *jl_arrayref(jl_array_t *a, size_t i)
503504
if (!a->flags.ptrarray) {
504505
jl_value_t *el_type = (jl_value_t*)jl_tparam0(jl_typeof(a));
505506
if (jl_is_uniontype(el_type)) {
507+
printf("here 1");
506508
uint8_t sel = ((uint8_t*)a->data)[jl_array_len(a) * a->elsize + i];
507509
el_type = jl_nth_union_component(el_type, sel);
508510
if (jl_is_datatype_singleton((jl_datatype_t*)el_type))
@@ -568,6 +570,7 @@ JL_DLLEXPORT void jl_arrayset(jl_array_t *a, jl_value_t *rhs, size_t i)
568570
}
569571
if (!a->flags.ptrarray) {
570572
if (jl_is_uniontype(el_type)) {
573+
printf("here 2");
571574
uint8_t *psel = &((uint8_t*)a->data)[jl_array_len(a) * a->elsize + i];
572575
unsigned nth = 0;
573576
if (!jl_find_union_component(el_type, jl_typeof(rhs), &nth))

0 commit comments

Comments
 (0)