diff options
-rw-r--r-- | src/lj_asm.c | 5 |
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) | |||
1373 | int pass3 = 0; | 1373 | int pass3 = 0; |
1374 | IRRef i; | 1374 | IRRef i; |
1375 | 1375 | ||
1376 | if (as->snapno && as->topslot > as->parent->topslot) { | ||
1377 | /* Force snap #0 alloc to prevent register overwrite in stack check. */ | ||
1378 | as->snapno = 0; | ||
1379 | asm_snap_alloc(as); | ||
1380 | } | ||
1376 | allow = asm_head_side_base(as, irp, allow); | 1381 | allow = asm_head_side_base(as, irp, allow); |
1377 | 1382 | ||
1378 | /* Scan all parent SLOADs and collect register dependencies. */ | 1383 | /* Scan all parent SLOADs and collect register dependencies. */ |