From e3bb36ba77f1f0bf1b1acc40885572ddcbfd1807 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 14 Apr 2021 13:46:08 +0200 Subject: [PATCH] Fix frame size after unwind rework After the unwind rework (commit 2d5db92a) the space used to save clobbered registers now lies between the nominal SP and the FP. Therefore, the size of that space should now be included in the frame size as reported by frame_size(), since this value is used to compute the nominal_sp_to_fp offset. --- cranelift/codegen/src/machinst/abi_impl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cranelift/codegen/src/machinst/abi_impl.rs b/cranelift/codegen/src/machinst/abi_impl.rs index 85a6d6831b..73d320a433 100644 --- a/cranelift/codegen/src/machinst/abi_impl.rs +++ b/cranelift/codegen/src/machinst/abi_impl.rs @@ -1285,7 +1285,7 @@ impl ABICallee for ABICalleeImpl { } // Save clobbered registers. - let (_, clobber_insts) = M::gen_clobber_save( + let (clobber_size, clobber_insts) = M::gen_clobber_save( self.call_conv, &self.flags, &self.clobbered, @@ -1304,7 +1304,7 @@ impl ABICallee for ABICalleeImpl { // [crate::machinst::abi_impl](this module) for more details // on stackframe layout and nominal SP maintenance. - self.total_frame_size = Some(total_stacksize); + self.total_frame_size = Some(total_stacksize + clobber_size as u32); insts }