]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Merge branch 'master' into v2.1
authorMike Pall <mike>
Mon, 28 Aug 2023 20:24:36 +0000 (22:24 +0200)
committerMike Pall <mike>
Mon, 28 Aug 2023 20:24:36 +0000 (22:24 +0200)
1  2 
src/lj_snap.c

diff --cc src/lj_snap.c
index 877ce099b9539b92ab4f1292066aeb807d3ab1b5,a6cd93d49f85178df4ee19ed7f57a89277e057e9..68de208f4471cdf37a981b8e9516e672ac4bace1
@@@ -876,15 -800,22 +876,23 @@@ static void snap_unsink(jit_State *J, G
        if (irs->r == RID_SINK && snap_sunk_store(T, ir, irs)) {
        IRIns *irk = &T->ir[irs->op1];
        TValue tmp, *val;
 -      lua_assert(irs->o == IR_ASTORE || irs->o == IR_HSTORE ||
 -                 irs->o == IR_FSTORE);
 +      lj_assertJ(irs->o == IR_ASTORE || irs->o == IR_HSTORE ||
 +                 irs->o == IR_FSTORE,
 +                 "sunk store with bad op %d", irs->o);
        if (irk->o == IR_FREF) {
-         lj_assertJ(irk->op2 == IRFL_TAB_META,
-                    "sunk store with bad field %d", irk->op2);
-         snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp);
-         /* NOBARRIER: The table is new (marked white). */
-         setgcref(t->metatable, obj2gco(tabV(&tmp)));
+         switch (irk->op2) {
+         case IRFL_TAB_META:
+           snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp);
+           /* NOBARRIER: The table is new (marked white). */
+           setgcref(t->metatable, obj2gco(tabV(&tmp)));
+           break;
+         case IRFL_TAB_NOMM:
+           /* Negative metamethod cache invalidated by lj_tab_set() below. */
+           break;
+         default:
 -          lua_assert(0);
++          lj_assertJ(0, "sunk store with bad field %d", irk->op2);
+           break;
+         }
        } else {
          irk = &T->ir[irk->op2];
          if (irk->o == IR_KSLOT) irk = &T->ir[irk->op1];