diff options
author | Thomas Lively <tlively@google.com> | 2023-11-21 08:50:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-20 23:50:20 -0800 |
commit | beb816be810caa0b32ab37986e7cae6f6cf11b1b (patch) | |
tree | 7414f7b3670626178d991c1d6b17dd106c4abbe7 /src/parser/context-decls.cpp | |
parent | a1e8bdc1d162f1f72e545960e552cf13b6c82be5 (diff) | |
download | binaryen-beb816be810caa0b32ab37986e7cae6f6cf11b1b.tar.gz binaryen-beb816be810caa0b32ab37986e7cae6f6cf11b1b.tar.bz2 binaryen-beb816be810caa0b32ab37986e7cae6f6cf11b1b.zip |
Fix a bug with unreachable control flow in IRBuilder (#6130)
When branches target control flow structures other than blocks or loops, the
IRBuilder wraps those control flow structures with an extra block for the
branches to target in Binaryen IR. Usually that block has the same type as the
control flow structure it wraps, but when the control flow structure is
unreachable because all its bodies are unreachable, the wrapper block may still
need to have a non-unreachable type if it is targeted by branches.
Previously the wrapper block would also be unreachable in that case. Fix the bug
by tracking whether the wrapper block will be targeted by any branches and use
the control flow structure's original, non-unreachable type if so.
Diffstat (limited to 'src/parser/context-decls.cpp')
0 files changed, 0 insertions, 0 deletions