s390x: Fix handling of sret arguments (#5116)

Skip synthetic StructReturn entries in the return value list.
Fixes https://github.com/bytecodealliance/wasmtime/issues/5089
This commit is contained in:
Ulrich Weigand
2022-10-25 19:40:10 +02:00
committed by GitHub
parent 441401f9d6
commit 39b3b1d772
4 changed files with 34 additions and 3 deletions

View File

@@ -165,6 +165,13 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
self.lower_ctx.sigs().abi_sig_for_sig_ref(sig_ref)
}
fn abi_first_ret(&mut self, sig_ref: SigRef, abi: &Sig) -> usize {
// Return the index of the first actual return value, excluding
// any StructReturn that might have been added to Sig.
let sig = &self.lower_ctx.dfg().signatures[sig_ref];
self.lower_ctx.sigs()[*abi].num_rets() - sig.returns.len()
}
fn abi_lane_order(&mut self, abi: &Sig) -> LaneOrder {
lane_order_for_call_conv(self.lower_ctx.sigs()[*abi].call_conv())
}