]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
LJ_GC64: Fix IR_VARG offset for fixed number of results.
authorMike Pall <mike>
Tue, 12 Jul 2022 20:21:26 +0000 (22:21 +0200)
committerMike Pall <mike>
Tue, 12 Jul 2022 20:21:26 +0000 (22:21 +0200)
Reported by George Vaintrub. Fixed by Sergey Kaplun.

src/lj_record.c

index faa9a5087ec45b5d33db1d138780c0cbfda15102..9c85f9f7bb600382704da4ae74337403b95dc85d 100644 (file)
@@ -1961,7 +1961,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
          emitir(IRTGI(IR_EQ), fr,
                 lj_ir_kint(J, (int32_t)frame_ftsz(J->L->base-1)));
        vbase = emitir(IRT(IR_SUB, IRT_IGC), REF_BASE, fr);
-       vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8));
+       vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8*(1+LJ_FR2)));
        for (i = 0; i < nload; i++) {
          IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
          J->base[dst+i] = lj_record_vload(J, vbase, i, t);