summaryrefslogtreecommitdiff
path: root/src/passes/Flatten.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-03-27 21:51:40 -0700
committerGitHub <noreply@github.com>2020-03-27 21:51:40 -0700
commit2b758fbdc46fc8fe5241bcf1ba5bbd81e6d556ed (patch)
treead75a0205850e7c3fa7e1a561eb378267aa7e798 /src/passes/Flatten.cpp
parentd595a45b66cbb4d59472d2954131ee1f4cf6ad8e (diff)
downloadbinaryen-2b758fbdc46fc8fe5241bcf1ba5bbd81e6d556ed.tar.gz
binaryen-2b758fbdc46fc8fe5241bcf1ba5bbd81e6d556ed.tar.bz2
binaryen-2b758fbdc46fc8fe5241bcf1ba5bbd81e6d556ed.zip
Error out when EH is used in unsupported code (#2713)
This calls `Fatal()` when EH instructions are used in unsupported code. Currently EH instructions are unsupported in Flatten, ReReloop, and DataFlow-using passes.
Diffstat (limited to 'src/passes/Flatten.cpp')
-rw-r--r--src/passes/Flatten.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Flatten.cpp b/src/passes/Flatten.cpp
index 0a6a7022a..9139d5dca 100644
--- a/src/passes/Flatten.cpp
+++ b/src/passes/Flatten.cpp
@@ -68,6 +68,11 @@ struct Flatten
return;
}
+ if (curr->is<Try>() || curr->is<Throw>() || curr->is<Rethrow>() ||
+ curr->is<BrOnExn>()) {
+ Fatal() << "Flatten does not support EH instructions yet";
+ }
+
if (Properties::isControlFlowStructure(curr)) {
// handle control flow explicitly. our children do not have control flow,
// but they do have preludes which we need to set up in the right place