aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_record.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index 54068697..29c024bf 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -995,10 +995,10 @@ static TRef rec_idx(jit_State *J, RecordIndex *ix)
995 cTValue *mo = lj_tab_getstr(mt, strref(J2G(J)->mmname[MM_newindex])); 995 cTValue *mo = lj_tab_getstr(mt, strref(J2G(J)->mmname[MM_newindex]));
996 hasmm = mo && !tvisnil(mo); 996 hasmm = mo && !tvisnil(mo);
997 } 997 }
998 if (hasmm || oldv == niltvg(J2G(J))) 998 if (hasmm)
999 emitir(IRTG(loadop, IRT_NIL), xref, 0); /* Guard for nil value. */ 999 emitir(IRTG(loadop, IRT_NIL), xref, 0); /* Guard for nil value. */
1000 else if (xrefop == IR_HREF) 1000 else if (xrefop == IR_HREF)
1001 emitir(IRTG(IR_NE, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J)))); 1001 emitir(IRTG(oldv == niltvg(J2G(J)) ? IR_EQ : IR_NE, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J))));
1002 if (ix->idxchain && rec_mm_lookup(J, ix, MM_newindex)) { /* Metamethod? */ 1002 if (ix->idxchain && rec_mm_lookup(J, ix, MM_newindex)) { /* Metamethod? */
1003 lua_assert(hasmm); 1003 lua_assert(hasmm);
1004 goto handlemm; 1004 goto handlemm;