diff options
author | Heejin Ahn <aheejin@gmail.com> | 2024-04-24 00:59:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 00:59:36 +0900 |
commit | 3b9dc42525553653d7477874e854584e957887b2 (patch) | |
tree | a53c1467e4f44eb0352afacbd8333c0baf03cde1 /src/passes/StringLowering.cpp | |
parent | 4bbae113dc144f80ff4880c74c7068a9f7b14295 (diff) | |
download | binaryen-3b9dc42525553653d7477874e854584e957887b2.tar.gz binaryen-3b9dc42525553653d7477874e854584e957887b2.tar.bz2 binaryen-3b9dc42525553653d7477874e854584e957887b2.zip |
[EH] Fix missing outer block for catchless try (#6519)
When translating a `try` expression, we may need an 'outer' block that
wraps the newly generated `try_table` so we can jump out of the
expression when an exception does not occur. (The condition we use is
when the `try` has any catches or if the `try` is a target of any
inner `try-delegate`s:
https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L677)
In case the `try` has either of `catch` or `delegate`, when we have the
'outer' block, we add the newly created `try_table` in the 'outer' block
and replace the whole expression with the block:
https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L670
https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L332-L340
But in case of a catchless `try`, we forgot to do that:
https://github.com/WebAssembly/binaryen/blob/219e668e87b012c0634043ed702534b8be31231f/src/passes/TranslateEH.cpp#L388
So this PR fixes it.
Diffstat (limited to 'src/passes/StringLowering.cpp')
0 files changed, 0 insertions, 0 deletions