summaryrefslogtreecommitdiff
path: root/src/wasm.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-13 12:38:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-13 12:38:44 -0700
commit22d10db3a9b04e5c225b0f472c07dba7ce9dc6d3 (patch)
treec38b3e8b4a7900d857583de9788b45ca1bfd8890 /src/wasm.cpp
parent348565b6a9a823c0fee30c96d8d783810d540a78 (diff)
parent377f1f661d373afe5770d1ff0d3a4772a71ef893 (diff)
downloadbinaryen-22d10db3a9b04e5c225b0f472c07dba7ce9dc6d3.tar.gz
binaryen-22d10db3a9b04e5c225b0f472c07dba7ce9dc6d3.tar.bz2
binaryen-22d10db3a9b04e5c225b0f472c07dba7ce9dc6d3.zip
Merge pull request #493 from WebAssembly/error-improvements
Error handling improvements
Diffstat (limited to 'src/wasm.cpp')
-rw-r--r--src/wasm.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm.cpp b/src/wasm.cpp
index 2157992e3..98268310a 100644
--- a/src/wasm.cpp
+++ b/src/wasm.cpp
@@ -33,7 +33,11 @@ struct BlockTypeSeeker : public PostWalker<BlockTypeSeeker, Visitor<BlockTypeSee
if (other == none) {
type = none;
} else if (other != unreachable) {
- type = other;
+ if (type == unreachable) {
+ type = other;
+ } else if (type != other) {
+ type = none; // poison value, we saw multiple types; this should not be consumed
+ }
}
}
}