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.
This commit is contained in:
Ulrich Weigand
2021-04-14 13:46:08 +02:00
parent 67cc42d4c3
commit e3bb36ba77

View File

@@ -1285,7 +1285,7 @@ impl<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M> {
}
// 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<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M> {
// [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
}