Skip to content

Commit dd6ac7b

Browse files
committed
mips: fix a bug when scanning the stack
Previously the assembler was reordering this code: jal tinygo_scanstack move $a0, $sp Into this: jal tinygo_scanstack nop move $a0, $sp So it was "helpfully" inserting a branch delay slot, even though this was already being taken care of. Somehow this didn't break, but it does break in the WIP threading branch (#4559) where this bug leads to a crash.
1 parent 09a22ac commit dd6ac7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime/asm_mipsx.S

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Do not reorder instructions to insert a branch delay slot.
2+
// We know what we're doing, and will manually fill the branch delay slot.
3+
.set noreorder
4+
15
.section .text.tinygo_scanCurrentStack
26
.global tinygo_scanCurrentStack
37
.type tinygo_scanCurrentStack, %function

0 commit comments

Comments
 (0)