Fix recording of BC_VARG.

Reported by Bachir Bendrissou.
This commit is contained in:
Mike Pall 2025-01-13 16:19:57 +01:00
parent 9d777346bc
commit 62e362afbb

View File

@ -1570,7 +1570,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
J->maxslot = dst + (BCReg)nresults; J->maxslot = dst + (BCReg)nresults;
} }
} else if (select_detect(J)) { /* y = select(x, ...) */ } else if (select_detect(J)) { /* y = select(x, ...) */
TRef tridx = J->base[dst-1]; TRef tridx = getslot(J, dst-1);
TRef tr = TREF_NIL; TRef tr = TREF_NIL;
ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]); ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]);
if (idx < 0) goto nyivarg; if (idx < 0) goto nyivarg;