diff options
Diffstat (limited to 'src/lj_asm.c')
-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 71d9a881..0b6738da 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -1721,6 +1721,11 @@ static void asm_head_side(ASMState *as) | |||
1721 | int pass3 = 0; | 1721 | int pass3 = 0; |
1722 | IRRef i; | 1722 | IRRef i; |
1723 | 1723 | ||
1724 | if (as->snapno && as->topslot > as->parent->topslot) { | ||
1725 | /* Force snap #0 alloc to prevent register overwrite in stack check. */ | ||
1726 | as->snapno = 0; | ||
1727 | asm_snap_alloc(as); | ||
1728 | } | ||
1724 | allow = asm_head_side_base(as, irp, allow); | 1729 | allow = asm_head_side_base(as, irp, allow); |
1725 | 1730 | ||
1726 | /* Scan all parent SLOADs and collect register dependencies. */ | 1731 | /* Scan all parent SLOADs and collect register dependencies. */ |