Add missing check for LJ_KEYINDEX in ITERN recording.
Reported by dragonorloong. Analyzed by vfprintf. #827
This commit is contained in:
@@ -1768,14 +1768,11 @@ static void asm_sload(ASMState *as, IRIns *ir)
|
||||
if ((ir->op2 & IRSLOAD_TYPECHECK)) {
|
||||
/* Need type check, even if the load result is unused. */
|
||||
asm_guardcc(as, irt_isnum(t) ? CC_AE : CC_NE);
|
||||
if (LJ_64 && irt_type(t) >= IRT_NUM) {
|
||||
if ((LJ_64 && irt_type(t) >= IRT_NUM) || (ir->op2 & IRSLOAD_KEYINDEX)) {
|
||||
lj_assertA(irt_isinteger(t) || irt_isnum(t),
|
||||
"bad SLOAD type %d", irt_type(t));
|
||||
#if LJ_GC64
|
||||
emit_u32(as, LJ_TISNUM << 15);
|
||||
#else
|
||||
emit_u32(as, LJ_TISNUM);
|
||||
#endif
|
||||
emit_u32(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX :
|
||||
LJ_GC64 ? (LJ_TISNUM << 15) : LJ_TISNUM);
|
||||
emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4);
|
||||
#if LJ_GC64
|
||||
} else if (irt_isnil(t)) {
|
||||
|
||||
Reference in New Issue
Block a user