Change handling of nil value markers in template tables.

Reported by Bernhard M. Wiedemann. #1348 #1155
This commit is contained in:
Mike Pall
2025-03-09 14:44:57 +01:00
parent a4f56a459a
commit 5eb9509468
6 changed files with 23 additions and 24 deletions

View File

@@ -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));
}
}