mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix recording of y = select(n, ...) for non-int indexes.
This commit is contained in:
parent
b3cf2c70f4
commit
5391a5f5b1
@ -2015,6 +2015,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
|||||||
TRef tr = TREF_NIL;
|
TRef tr = TREF_NIL;
|
||||||
ptrdiff_t idx = select_mode(J, tridx, &J->L->base[dst-1]);
|
ptrdiff_t idx = select_mode(J, tridx, &J->L->base[dst-1]);
|
||||||
if (idx < 0) goto nyivarg;
|
if (idx < 0) goto nyivarg;
|
||||||
|
if (idx != 0 && !tref_isinteger(tridx))
|
||||||
|
tridx = emitir(IRTGI(IR_TOINT), tridx, IRTOINT_INDEX);
|
||||||
if (idx != 0 && tref_isk(tridx)) {
|
if (idx != 0 && tref_isk(tridx)) {
|
||||||
emitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT),
|
emitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT),
|
||||||
fr, lj_ir_kint(J, frofs+8*(int32_t)idx));
|
fr, lj_ir_kint(J, frofs+8*(int32_t)idx));
|
||||||
|
Loading…
Reference in New Issue
Block a user