Skip to content

Commit 11989a0

Browse files
committed
Fix rooting when rehashing iddict
1 parent e44c09e commit 11989a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/iddict.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ JL_DLLEXPORT jl_genericmemory_t *jl_idtable_rehash(jl_genericmemory_t *a, size_t
1515
size_t sz = a->length;
1616
size_t i;
1717
jl_value_t **ol = (jl_value_t **) a->ptr;
18-
jl_genericmemory_t *newa = jl_alloc_memory_any(newsz);
18+
jl_genericmemory_t *newa = NULL;
1919
// keep the original memory in the original slot since we need `ol`
2020
// to be valid in the loop below.
2121
JL_GC_PUSH2(&newa, &a);
22+
newa = jl_alloc_memory_any(newsz);
2223
for (i = 0; i < sz; i += 2) {
2324
if (ol[i + 1] != NULL) {
2425
jl_table_assign_bp(&newa, ol[i], ol[i + 1]);

0 commit comments

Comments
 (0)