official lua bugfix

This commit is contained in:
Cloud Wu
2017-09-04 16:23:19 +08:00
parent 553c30c6d1
commit 100329f09f

View File

@@ -652,10 +652,11 @@ static void clearkeys (global_State *g, GCObject *l, GCObject *f) {
Table *h = gco2t(l);
Node *n, *limit = gnodelast(h);
for (n = gnode(h, 0); n < limit; n++) {
if (iscleared(g, gkey(n))) {
if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) {
setnilvalue(gval(n)); /* remove value ... */
removeentry(n); /* and remove entry from table */
}
if (ttisnil(gval(n))) /* is entry empty? */
removeentry(n); /* remove entry from table */
}
}
}