Skip to content

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Apr 23, 2024

shouldBeRef incorrectly assumed that all throw_refs within a catch body had been generated from rethrows, which was not true, because throw_refs are also created when translating try-delegates:

curr->body = builder.makeThrowRef(innerBody);

This fixes the assumption and changes cast to dynCast.

`shouldBeRef` incorrectly assumed that all `throw_ref`s within a `catch` body had been generated from `rethrow`s, which was not true, because `throw_ref`s are also created when translating `try`-`delegate`s: https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L304 This fixes the assumption and changes `cast` to `dynCast`.
@aheejin aheejin requested a review from kripken April 23, 2024 16:06
@aheejin aheejin merged commit 94ddae0 into WebAssembly:main Apr 23, 2024
@aheejin aheejin deleted the translate_fix_throw_ref branch April 23, 2024 16:59
@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