Permalink
Browse files

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.
  • Loading branch information...
1 parent 95b2985 commit c473b392f6e9bc57c824c2c8e04bb63dcaf2ef2e @bacek bacek committed Feb 18, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 dynext/pmc/luatable.pmc
View
@@ -341,12 +341,10 @@ static void lua_mark_table(PARROT_INTERP, Parrot_LuaTable_attributes *t, STRING
}
for (i = 0; i < t->size; i++) {
- if (v[i].val) {
- if (mark_key)
- Parrot_gc_mark_PMC_alive(interp, v[i].key);
- if (mark_val)
- Parrot_gc_mark_PMC_alive(interp, v[i].val);
- }
+ if (mark_val && v[i].val)
+ Parrot_gc_mark_PMC_alive(interp, v[i].val);
+ if (mark_key && v[i].key)
+ Parrot_gc_mark_PMC_alive(interp, v[i].key);
}
}

0 comments on commit c473b39

Please sign in to comment.