aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_record.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index 29c024bf..e89d9c26 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -981,7 +981,13 @@ static TRef rec_idx(jit_State *J, RecordIndex *ix)
981 981
982 if (ix->val == 0) { /* Indexed load */ 982 if (ix->val == 0) { /* Indexed load */
983 IRType t = itype2irt(oldv); 983 IRType t = itype2irt(oldv);
984 TRef res = emitir(IRTG(loadop, t), xref, 0); 984 TRef res;
985 if (oldv == niltvg(J2G(J))) {
986 emitir(IRTG(IR_EQ, IRT_PTR), xref, lj_ir_kptr(J, niltvg(J2G(J))));
987 res = TREF_NIL;
988 } else {
989 res = emitir(IRTG(loadop, t), xref, 0);
990 }
985 if (t == IRT_NIL && ix->idxchain && rec_mm_lookup(J, ix, MM_index)) 991 if (t == IRT_NIL && ix->idxchain && rec_mm_lookup(J, ix, MM_index))
986 goto handlemm; 992 goto handlemm;
987 if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitives. */ 993 if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitives. */