Skip to content
This repository was archived by the owner on Jun 9, 2018. It is now read-only.

Commit c473b39

Browse files
committed
Fix (probably very old bug) bug with marking of LuaTable.
Previously if we set C<key> to NULL C<value> then C<key> wasn't marked.
1 parent 95b2985 commit c473b39

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dynext/pmc/luatable.pmc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,10 @@ static void lua_mark_table(PARROT_INTERP, Parrot_LuaTable_attributes *t, STRING
341341
}
342342

343343
for (i = 0; i < t->size; i++) {
344-
if (v[i].val) {
345-
if (mark_key)
346-
Parrot_gc_mark_PMC_alive(interp, v[i].key);
347-
if (mark_val)
348-
Parrot_gc_mark_PMC_alive(interp, v[i].val);
349-
}
344+
if (mark_val && v[i].val)
345+
Parrot_gc_mark_PMC_alive(interp, v[i].val);
346+
if (mark_key && v[i].key)
347+
Parrot_gc_mark_PMC_alive(interp, v[i].key);
350348
}
351349
}
352350

0 commit comments

Comments
 (0)