diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-12-28 17:05:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-28 17:05:09 -0800 |
commit | ad723a19b018a786bcbec8d9e16160f30959e60e (patch) | |
tree | e055a152b334e962f83b3d7f81d48e28d17cd6e3 /src/tools/wasm-opt.cpp | |
parent | 3352e23d5aea9c8fc24147ae6210c7fcee2db0fc (diff) | |
download | binaryen-ad723a19b018a786bcbec8d9e16160f30959e60e.tar.gz binaryen-ad723a19b018a786bcbec8d9e16160f30959e60e.tar.bz2 binaryen-ad723a19b018a786bcbec8d9e16160f30959e60e.zip |
[EH][GC] Fix nested pop after removing ref.cast (#4407)
`ref.cast` can be statically removed when the ref's type is a subtype of
the intended RTT type and either of `--ignore-implicit-traps` or
`--traps-never-happen` is given: https://github.com/WebAssembly/binaryen/blob/083ab9842ec3d4ca278c95e1a33112ae7cd4d9e5/src/passes/OptimizeInstructions.cpp#L1603-L1624
Some more context: https://github.com/WebAssembly/binaryen/pull/4097#discussion_r694456784
But this can create a block in which a `pop` is nested, which makes the
`catch` invalid. The test in this PR is the same as the example given by
@kripken in #4237. This calls the fixup function
`EHUtils::handleBlockNestedPops` at the end of the pass to fix this.
Also, because this pass creates a lot of blocks in other patterns, I
think it is possible there can be other patterns to cause this kind of
`pop` nesting.
Diffstat (limited to 'src/tools/wasm-opt.cpp')
0 files changed, 0 insertions, 0 deletions