mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
Fix handling of instable types in TNEW/TDUP load forwarding.
Analyzed by Sergey Kaplun. #994
This commit is contained in:
parent
8c20c3b1a3
commit
9f452bbef5
@ -197,7 +197,8 @@ static TRef fwd_ahload(jit_State *J, IRRef xref)
|
|||||||
if (key->o == IR_KSLOT) key = IR(key->op1);
|
if (key->o == IR_KSLOT) key = IR(key->op1);
|
||||||
lj_ir_kvalue(J->L, &keyv, key);
|
lj_ir_kvalue(J->L, &keyv, key);
|
||||||
tv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv);
|
tv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv);
|
||||||
lua_assert(itype2irt(tv) == irt_type(fins->t));
|
if (itype2irt(tv) != irt_type(fins->t))
|
||||||
|
return 0; /* Type instability in loop-carried dependency. */
|
||||||
if (irt_isnum(fins->t))
|
if (irt_isnum(fins->t))
|
||||||
return lj_ir_knum_u64(J, tv->u64);
|
return lj_ir_knum_u64(J, tv->u64);
|
||||||
else if (LJ_DUALNUM && irt_isint(fins->t))
|
else if (LJ_DUALNUM && irt_isint(fins->t))
|
||||||
|
Loading…
Reference in New Issue
Block a user