OSDN Git Service

[WebAssembly] Fix unwind destination mismatches in CFG stackify
authorHeejin Ahn <aheejin@gmail.com>
Sat, 30 Mar 2019 11:04:48 +0000 (11:04 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Sat, 30 Mar 2019 11:04:48 +0000 (11:04 +0000)
commit6ed15740eff6cb4c917615d153881389cce8cf89
tree48dc9c4362e45ce7ba4320dc7a89eb70d1e5925c
parentcc037ac6e20feae4667ccff29592d87fa22120ad
[WebAssembly] Fix unwind destination mismatches in CFG stackify

Summary:
Linearing the control flow by placing `try`/`end_try` markers can create
mismatches in unwind destinations. This patch resolves these mismatches
by wrapping those instructions with an incorrect unwind destination with
a nested `try`/`catch`/`end_try` and branching to the right destination
within the new catch block.

Reviewers: dschuff

Subscribers: sunfish, sbc100, jgravelle-google, chrib, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D48345

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357343 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
lib/Target/WebAssembly/WebAssemblyUtilities.cpp
test/CodeGen/WebAssembly/cfg-stackify-eh.ll