summaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
authorMike Pall <mike>2014-11-28 20:20:12 +0100
committerMike Pall <mike>2014-11-28 20:20:12 +0100
commitc75c62b489ebd0b4f9eb35af3b7d5a071939721e (patch)
tree433d787b37a1c9c2c6dec6e146f3d6f786f6dc56 /src/lj_asm.c
parenta31c317fb59964be6ab4414fbaea4abebef1c0f5 (diff)
downloadluajit2-c75c62b489ebd0b4f9eb35af3b7d5a071939721e.tar.gz
Fix snapshot #0 handling for traces with a stack check on entry.
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 2afa92d0..f15458b9 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -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. */