diff options
author | Mike Pall <mike> | 2022-04-02 21:24:18 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2022-04-02 21:27:43 +0200 |
commit | 1cdff194cfa22cfe5bfc0e908b909e2dea40aa70 (patch) | |
tree | 3f32998ff919a48d2d9595e91f1d90c7807cb947 /src/lj_asm_x86.h | |
parent | e2c312e0deb874aa5fa8ce502c08d87deb38e82f (diff) | |
download | luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.tar.gz luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.tar.bz2 luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.zip |
Add missing check for LJ_KEYINDEX in ITERN recording.
Reported by dragonorloong. Analyzed by vfprintf. #827
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r-- | src/lj_asm_x86.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 38069e1d..4465efa2 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -1768,14 +1768,11 @@ static void asm_sload(ASMState *as, IRIns *ir) | |||
1768 | if ((ir->op2 & IRSLOAD_TYPECHECK)) { | 1768 | if ((ir->op2 & IRSLOAD_TYPECHECK)) { |
1769 | /* Need type check, even if the load result is unused. */ | 1769 | /* Need type check, even if the load result is unused. */ |
1770 | asm_guardcc(as, irt_isnum(t) ? CC_AE : CC_NE); | 1770 | asm_guardcc(as, irt_isnum(t) ? CC_AE : CC_NE); |
1771 | if (LJ_64 && irt_type(t) >= IRT_NUM) { | 1771 | if ((LJ_64 && irt_type(t) >= IRT_NUM) || (ir->op2 & IRSLOAD_KEYINDEX)) { |
1772 | lj_assertA(irt_isinteger(t) || irt_isnum(t), | 1772 | lj_assertA(irt_isinteger(t) || irt_isnum(t), |
1773 | "bad SLOAD type %d", irt_type(t)); | 1773 | "bad SLOAD type %d", irt_type(t)); |
1774 | #if LJ_GC64 | 1774 | emit_u32(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : |
1775 | emit_u32(as, LJ_TISNUM << 15); | 1775 | LJ_GC64 ? (LJ_TISNUM << 15) : LJ_TISNUM); |
1776 | #else | ||
1777 | emit_u32(as, LJ_TISNUM); | ||
1778 | #endif | ||
1779 | emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4); | 1776 | emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4); |
1780 | #if LJ_GC64 | 1777 | #if LJ_GC64 |
1781 | } else if (irt_isnil(t)) { | 1778 | } else if (irt_isnil(t)) { |