Browse Source
Including the outgoing arguments area when computing the caller's sp (#8636)
pull/8638/head
Trevor Elliott
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
3 deletions
-
cranelift/codegen/src/machinst/abi.rs
-
cranelift/codegen/src/machinst/vcode.rs
|
|
@ -1942,12 +1942,13 @@ impl<M: ABIMachineSpec> Callee<M> { |
|
|
|
frame_layout.clobber_size + frame_layout.fixed_frame_storage_size |
|
|
|
} |
|
|
|
|
|
|
|
/// Returns offset from the nominal SP to caller's SP.
|
|
|
|
pub fn nominal_sp_to_caller_sp_offset(&self) -> u32 { |
|
|
|
/// Returns offset from the SP to caller's SP.
|
|
|
|
pub fn sp_to_caller_sp_offset(&self) -> u32 { |
|
|
|
let frame_layout = self.frame_layout(); |
|
|
|
frame_layout.clobber_size |
|
|
|
+ frame_layout.fixed_frame_storage_size |
|
|
|
+ frame_layout.setup_area_size |
|
|
|
+ frame_layout.outgoing_args_size |
|
|
|
} |
|
|
|
|
|
|
|
/// Returns the size of arguments expected on the stack.
|
|
|
|
|
|
@ -1138,7 +1138,7 @@ impl<I: VCodeInst> VCode<I> { |
|
|
|
} else { |
|
|
|
let slot = alloc.as_stack().unwrap(); |
|
|
|
let sp_offset = self.abi.get_spillslot_offset(slot); |
|
|
|
let sp_to_caller_sp_offset = self.abi.nominal_sp_to_caller_sp_offset(); |
|
|
|
let sp_to_caller_sp_offset = self.abi.sp_to_caller_sp_offset(); |
|
|
|
let caller_sp_to_cfa_offset = |
|
|
|
crate::isa::unwind::systemv::caller_sp_to_cfa_offset(); |
|
|
|
let cfa_to_sp_offset = -((sp_to_caller_sp_offset + caller_sp_to_cfa_offset) as i64); |
|
|
|