From 54b78e7c66bff326a0223aac1fd5373515ca3014 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Wed, 12 Oct 2016 17:36:45 +0200 Subject: [PATCH] LJ_GC64: Various fixes. Contributed by Peter Cawley. --- src/lj_record.c | 2 ++ src/lj_target_x86.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lj_record.c b/src/lj_record.c index 76699a9f..48018f42 100644 --- a/src/lj_record.c +++ b/src/lj_record.c @@ -1765,6 +1765,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) int32_t numparams = J->pt->numparams; ptrdiff_t nvararg = frame_delta(J->L->base-1) - numparams - 1 - LJ_FR2; lua_assert(frame_isvarg(J->L->base-1)); + if (LJ_FR2 && dst > J->maxslot) + J->base[dst-1] = 0; /* Prevent resurrection of unrelated slot. */ if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */ ptrdiff_t i; if (nvararg < 0) nvararg = 0; diff --git a/src/lj_target_x86.h b/src/lj_target_x86.h index d5429597..c7be59ad 100644 --- a/src/lj_target_x86.h +++ b/src/lj_target_x86.h @@ -31,7 +31,7 @@ enum { FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ RID_MAX, RID_MRM = RID_MAX, /* Pseudo-id for ModRM operand. */ - RID_RIP = RID_MAX+1, /* Pseudo-id for RIP (x64 only). */ + RID_RIP = RID_MAX+5, /* Pseudo-id for RIP (x64 only), rm bits = 5. */ /* Calling conventions. */ RID_SP = RID_ESP,