From 4472c3bc26dc36a334ab7d7bf69b5a628bc65ba7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 29 Jan 2021 10:00:38 -0800 Subject: [PATCH] Save/restore the frame pointer in fiber switching Turns out this is another caller-saved register! --- crates/fiber/src/arch/aarch64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fiber/src/arch/aarch64.S b/crates/fiber/src/arch/aarch64.S index 61ceebeb4853..96db800291d1 100644 --- a/crates/fiber/src/arch/aarch64.S +++ b/crates/fiber/src/arch/aarch64.S @@ -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]! @@ -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)