[WebAssembly] Fix catch unwind mismatches
authorHeejin Ahn <aheejin@gmail.com>
Thu, 31 Dec 2020 06:29:38 +0000 (22:29 -0800)
committerHeejin Ahn <aheejin@gmail.com>
Sat, 6 Feb 2021 15:13:38 +0000 (07:13 -0800)
commit9f770b36cbf62b7226174402fb71007f56e5f04f
tree78cc61f96ee6ebc5f77a85972c35fa13736bf11e
parented41945faadab27036d368cda9223dc3cb6eb840
[WebAssembly] Fix catch unwind mismatches

This fixes unwind destination mismatches caused by 'catch'es, which
occur when a foreign exception is not caught by the nearest `catch` and
the next outer `catch` is not the catch it should unwind to, or the next
unwind destination should be the caller instead. This kind of mismatches
didn't exist in the previous version of the spec, because in the
previous spec `catch` was effectively `catch_all`, catching all
exceptions.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D94049
llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll