summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index a8bb4a536..337065b91 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -651,8 +651,11 @@ void FunctionValidator::visitBlock(Block* curr) {
auto iter = breakTypes.find(curr->name);
assert(iter != breakTypes.end()); // we set it ourselves
for (Type breakType : iter->second) {
- // none or unreachable means a poison value that we should ignore - if
- // consumed, it will error
+ if (breakType == Type::none && curr->type == Type::unreachable) {
+ // We allow empty breaks to unreachable blocks.
+ continue;
+ }
+
shouldBeSubType(breakType,
curr->type,
curr,