Skip to content

Commit f01ebca

Browse files
authored
pulley: Fix frame calculation on non-tail ABIs (#10535)
This fixes the Pulley ABI code to only have a tail-call-specific adjustment on the tail ABI, not all ABIs. This matches what other backends such as riscv64 do as well. This is not exposed through wasm I believe because no native signature can exercise this code (I think) and all wasm code uses the `tail` ABI anyway. This was discovered by running Cranelift filetests using ASAN which is something I hope to be able to add to our CI in the near future.
1 parent d928d8d commit f01ebca

File tree

1 file changed

+2
-2
lines changed
  • cranelift/codegen/src/isa/pulley_shared

1 file changed

+2
-2
lines changed

cranelift/codegen/src/isa/pulley_shared/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,14 @@ where
405405
}
406406

407407
fn gen_return(
408-
_call_conv: isa::CallConv,
408+
call_conv: isa::CallConv,
409409
_isa_flags: &PulleyFlags,
410410
frame_layout: &FrameLayout,
411411
) -> SmallInstVec<Self::I> {
412412
let mut insts = SmallVec::new();
413413

414414
// Handle final stack adjustments for the tail-call ABI.
415-
if frame_layout.tail_args_size > 0 {
415+
if call_conv == isa::CallConv::Tail && frame_layout.tail_args_size > 0 {
416416
insts.extend(Self::gen_sp_reg_adjust(
417417
frame_layout.tail_args_size.try_into().unwrap(),
418418
));

0 commit comments

Comments
 (0)