diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-12-06 16:42:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 16:42:56 -0800 |
commit | f0668172831da496a6a781c82fa4b2dc0f4c9028 (patch) | |
tree | 5c50a56d7bf06fc0100172bd273cefd8f8703314 /src/js/binaryen.js-extern-pre.js | |
parent | 464240c0fecc324064b13aacd26f12e69228e0fb (diff) | |
download | binaryen-f0668172831da496a6a781c82fa4b2dc0f4c9028.tar.gz binaryen-f0668172831da496a6a781c82fa4b2dc0f4c9028.tar.bz2 binaryen-f0668172831da496a6a781c82fa4b2dc0f4c9028.zip |
[EH] Fix binary parsing for catchless try + inner delegate (#4370)
We do some postprocessing after parsing `Try` to make sure `delegate`
only targets `try`s and not `block`s:
https://github.com/WebAssembly/binaryen/blob/9659f9b07c1196447edee68fe04c8d7dd2480652/src/wasm/wasm-binary.cpp#L6404-L6426
But in case the outer `try` has neither of `catch` nor `delegate`, the
previous code just return prematurely, skipping the postprocessing part,
resulting in a binary parsing error. This PR removes that early-exiting
code.
Some test outputs have changed because `try`s are assigned labels after
the early exit. But those labels can be removed by other optimization
passes when there is no inner `rethrow` or `delegate` that targets them.
(On a side note, the restriction that `delegate` cannot target a `block`
has been removed a few months ago in the spec, so if a `delegate`
targets a `block`, it means it is just rethrown from that block. But I
still think this is a convenient invariant to hold at least within the
binaryen IR. I'm planning to allow parsing of `delegate` targeting
`block`s later, but I will make them point to `try` when read in the
IR. At the moment the LLVM toolchain does not generate such code.)
Diffstat (limited to 'src/js/binaryen.js-extern-pre.js')
0 files changed, 0 insertions, 0 deletions