uweigand opened PR #5116 from s390x-sret
to main
:
Skip synthetic StructReturn entries in the return value list. Fixes https://github.com/bytecodealliance/wasmtime/issues/5089
CC @cfallin
This mirrors the implementation in
gen_call_common
, and does fix the actual crash. I still think this could be improved further:
- It's unfortunate that whether or not a synthetic
StructReturn
was added cannot be discovered solely from looking at theSig
(orSigData
) - at the moment you always have to look at theSigRef
as well.- There appears to be a discrepancy between
call_clobbers
, which considers allStructReturn
return values as clobbers, andgen_call_common
, which only skips thoseStructReturn
s that were added bymissing_struct_return
. Shouldn't these two be in sync? (OTOH does any code ever actually have aStructReturn
on the return list that isn't added bymissing_struct_return
?)- This whole mechanism probably should be platform-specific anyway. The fact that the incoming return-buffer address needs to be preserved in a return register is a property of the Intel ABI only - AFAIK none of the other ABIs we support have that requirement (s390x certainly does not).
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
cfallin submitted PR review.
cfallin merged PR #5116.
Last updated: Dec 23 2024 at 12:05 UTC