[PATCH] D147881: [WebAssembly] Correctly check end_if/end_try with else/catch

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 9 04:37:23 PDT 2023


aheejin created this revision.
aheejin added reviewers: dschuff, asb, aardappel.
Herald added subscribers: pmatos, wingo, ecnelises, sunfish, hiraditya, jgravelle-google, sbc100.
Herald added a project: All.
aheejin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When we encounter an `else`, `catch`, or `catch_all`, we currently just
push the structure `NestingType` and don't preserve the original `if`
and `try`'s signature. So after we pass `else`/`catch`/`catch_all`, we
can't check if the values on stack have the correct types when we
encounter `end_if` or `end_try`. This CL fixes the issue, and modifies
the existing test to be correct (some of them had `try` without
`catch`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147881

Files:
  llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
  llvm/test/MC/WebAssembly/type-checker-errors.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147881.511987.patch
Type: text/x-patch
Size: 3185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230409/05c415bb/attachment.bin>


More information about the llvm-commits mailing list