Skip to content

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Apr 22, 2024

hen the function return type is concrete, the translation result of a try-delegate that targets the caller includes a return that returns the whole function body:

// If sometype (func's type) is concrete:
// (throw_ref
// (block $caller_delegate_br_target (result exnref)
// (return
// ...
// (try_table (catch_all_ref $caller_delegate_br_target)
// ...
// )
// ...
// )
// )
// )
// )

We should do that based on the function's return type, not the function body's return type. The previous code didn't handle the case where the function's return type is concrete but the function body's return type is unreachable.

hen the function return type is concrete, the translation result of a `try`-`delegate` that targets the caller includes a `return` that returns the whole function body: https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L751-L763 We should do that based on the function's return type, not the function body's return type. The previous code didn't handle the case where the function's return type is concrete but the function body's return type is unreachable.
@aheejin aheejin requested a review from kripken April 22, 2024 06:08
@aheejin aheejin merged commit a3c7890 into WebAssembly:main Apr 23, 2024
@aheejin aheejin deleted the translate_fix_concrete_result branch April 23, 2024 08:37
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants