aboutsummaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
authorMike Pall <mike>2016-10-16 21:04:38 +0200
committerMike Pall <mike>2016-10-16 21:04:38 +0200
commit6a25014c1c33448cabdc013ccb9e5c4fc98a0238 (patch)
treec3c3bfc7ceadd3f38c02e31fa8754bfaea90c323 /src/lj_record.c
parent3f43f09413c49a1f4cffc0e060d755e84c5df85e (diff)
downloadluajit-6a25014c1c33448cabdc013ccb9e5c4fc98a0238.tar.gz
luajit-6a25014c1c33448cabdc013ccb9e5c4fc98a0238.tar.bz2
luajit-6a25014c1c33448cabdc013ccb9e5c4fc98a0238.zip
LJ_FR2: Fix slot 1 handling.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index 48018f42..a858ffa9 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -105,7 +105,7 @@ static void rec_check_slots(jit_State *J)
105 lua_assert(tref_isfunc(tr)); 105 lua_assert(tref_isfunc(tr));
106#if LJ_FR2 106#if LJ_FR2
107 } else if (s == 1) { 107 } else if (s == 1) {
108 lua_assert(0); 108 lua_assert((tr & ~TREF_FRAME) == 0);
109#endif 109#endif
110 } else if ((tr & TREF_FRAME)) { 110 } else if ((tr & TREF_FRAME)) {
111 GCfunc *fn = gco2func(frame_gc(tv)); 111 GCfunc *fn = gco2func(frame_gc(tv));
@@ -747,7 +747,7 @@ void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs)
747 } 747 }
748 /* Move func + args down. */ 748 /* Move func + args down. */
749 if (LJ_FR2 && J->baseslot == 2) 749 if (LJ_FR2 && J->baseslot == 2)
750 J->base[func+1] = 0; 750 J->base[func+1] = TREF_FRAME;
751 memmove(&J->base[-1-LJ_FR2], &J->base[func], sizeof(TRef)*(J->maxslot+1+LJ_FR2)); 751 memmove(&J->base[-1-LJ_FR2], &J->base[func], sizeof(TRef)*(J->maxslot+1+LJ_FR2));
752 /* Note: the new TREF_FRAME is now at J->base[-1] (even for slot #0). */ 752 /* Note: the new TREF_FRAME is now at J->base[-1] (even for slot #0). */
753 /* Tailcalls can form a loop, so count towards the loop unroll limit. */ 753 /* Tailcalls can form a loop, so count towards the loop unroll limit. */