Skip to content

Commit

Permalink
Save/restore the frame pointer in fiber switching
Browse files Browse the repository at this point in the history
Turns out this is another caller-saved register!
  • Loading branch information
alexcrichton committed Feb 1, 2021
1 parent 74eb448 commit 4472c3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/fiber/src/arch/aarch64.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TYPE(wasmtime_fiber_switch)
FUNCTION(wasmtime_fiber_switch):
// Save all callee-saved registers on the stack since we're assuming
// they're clobbered as a result of the stack switch.
str lr, [sp, -16]!
stp lr, fp, [sp, -16]!
stp x20, x19, [sp, -16]!
stp x22, x21, [sp, -16]!
stp x24, x23, [sp, -16]!
Expand Down Expand Up @@ -49,7 +49,7 @@ FUNCTION(wasmtime_fiber_switch):
ldp x24, x23, [sp], 16
ldp x22, x21, [sp], 16
ldp x20, x19, [sp], 16
ldr lr, [sp], 16
ldp lr, fp, [sp], 16
ret
SIZE(wasmtime_fiber_switch)

Expand Down

0 comments on commit 4472c3b

Please sign in to comment.