Skip to content

Commit

Permalink
Fix handling of instable types in TNEW/TDUP load forwarding.
Browse files Browse the repository at this point in the history
Analyzed by Sergey Kaplun. #994
  • Loading branch information
Mike Pall committed Jun 2, 2023
1 parent 8c20c3b commit 9f452bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lj_opt_mem.c
Expand Up @@ -197,7 +197,8 @@ static TRef fwd_ahload(jit_State *J, IRRef xref)
if (key->o == IR_KSLOT) key = IR(key->op1);
lj_ir_kvalue(J->L, &keyv, key);
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))
return lj_ir_knum_u64(J, tv->u64);
else if (LJ_DUALNUM && irt_isint(fins->t))
Expand Down

0 comments on commit 9f452bb

Please sign in to comment.