]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix snapshot #0 handling for traces with a stack check on entry.
authorMike Pall <mike>
Fri, 28 Nov 2014 19:20:12 +0000 (20:20 +0100)
committerMike Pall <mike>
Fri, 28 Nov 2014 19:20:12 +0000 (20:20 +0100)
src/lj_asm.c

index 2afa92d06e0c4119a9cff58013850508f5fd99a7..f15458b9e358b67e2f3ad9243cccd91bff7220e1 100644 (file)
@@ -1373,6 +1373,11 @@ static void asm_head_side(ASMState *as)
   int pass3 = 0;
   IRRef i;
 
+  if (as->snapno && as->topslot > as->parent->topslot) {
+    /* Force snap #0 alloc to prevent register overwrite in stack check. */
+    as->snapno = 0;
+    asm_snap_alloc(as);
+  }
   allow = asm_head_side_base(as, irp, allow);
 
   /* Scan all parent SLOADs and collect register dependencies. */