Change handling of nil value markers in template tables.
Reported by Bernhard M. Wiedemann. #1348 #1155 Fixes from Peter Cawley, Christian Clason, Lewis Russell.
This commit is contained in:
@@ -194,6 +194,7 @@ GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt)
|
||||
Node *next = nextnode(kn);
|
||||
/* Don't use copyTV here, since it asserts on a copy of a dead key. */
|
||||
n->val = kn->val; n->key = kn->key;
|
||||
if (tvistab(&n->val)) setnilV(&n->val); /* Replace nil value marker. */
|
||||
setmref(n->next, next == NULL? next : (Node *)((char *)next + d));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user