Repository navigation
[I64ToI32Lowering] Fix return_call_indirect result type - #9325
Merged
kripken merged 1 commit intoOct 29, 2026
Merged
Conversation
Fixes #9244. Signed-off-by: Akshat Lakhera <akshatlnct2024@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request updates the I64ToI32Lowering pass to ensure that return calls, which have an unreachable type, correctly preserve the results of their original signature. Specifically, if the call is a return call, the results are retrieved from the original signature instead of the call's type. A new LIT test has also been added to verify this behavior. There are no review comments, and I have no additional feedback to provide.
Contributor
Author
kripken
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9244.
I64ToI32Lowering rebuilt return_call_indirect using the results passed in from the call's own type, but a return call has type unreachable, so when the callee's signature had results the lowered call_indirect ended up with a signature that had none. The fix is in visitCallIndirect: for return calls the results now come from the heap type's signature instead. i64 results on return calls still hit the existing Fatal, so this only affects signatures whose results don't need lowering.
I added a lit test, i64-to-i32-lowering-return-call-indirect.wast, with CHECK lines generated by update_lit_checks.py. It covers a return_call_indirect with no results and one with an i64 param and an i32 result, and it fails without the change and passes with it. The rest of the lit suite shows no new failures locally.