aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lj_tab.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lj_tab.c b/src/lj_tab.c
index 5d68cc54..006a87ff 100644
--- a/src/lj_tab.c
+++ b/src/lj_tab.c
@@ -439,6 +439,18 @@ TValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key)
439 freenode->next = n->next; 439 freenode->next = n->next;
440 setmref(n->next, NULL); 440 setmref(n->next, NULL);
441 setnilV(&n->val); 441 setnilV(&n->val);
442 /* Rechain pseudo-resurrected string keys with colliding hashes. */
443 while (nextnode(freenode)) {
444 Node *nn = nextnode(freenode);
445 if (tvisstr(&nn->key) && !tvisnil(&nn->val) &&
446 hashstr(t, strV(&nn->key)) == n) {
447 freenode->next = nn->next;
448 nn->next = n->next;
449 setmref(n->next, nn);
450 } else {
451 freenode = nn;
452 }
453 }
442 } else { /* Otherwise use free node. */ 454 } else { /* Otherwise use free node. */
443 setmrefr(freenode->next, n->next); /* Insert into chain. */ 455 setmrefr(freenode->next, n->next); /* Insert into chain. */
444 setmref(n->next, freenode); 456 setmref(n->next, freenode);