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];