summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-06-08 18:56:10 -0700
committerGitHub <noreply@github.com>2021-06-08 18:56:10 -0700
commitcdc1bb3406f40bdab918749d020e0ef03942434d (patch)
treec8ac8e03bc1939282bd164e4869f73269aaad3ac /src/wasm/wasm-validator.cpp
parenteac90b56d4a749f10d440e4bb7fd744e4bc756e8 (diff)
downloadbinaryen-cdc1bb3406f40bdab918749d020e0ef03942434d.tar.gz
binaryen-cdc1bb3406f40bdab918749d020e0ef03942434d.tar.bz2
binaryen-cdc1bb3406f40bdab918749d020e0ef03942434d.zip
[Wasm GC] Properly validate BrOn* (#3928)
The noteBreak call was in the wrong place, causing us to not note breaks from BrOnNull for example, which could make validation miss errors. Noticed in #3926
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index bbc92f09c..6035a38a9 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2252,10 +2252,10 @@ void FunctionValidator::visitBrOn(BrOn* curr) {
// casts to.
shouldBeTrue(
curr->rtt->type.isRtt(), curr, "br_on_cast rtt must have rtt type");
- noteBreak(curr->name, curr->getSentType(), curr);
} else {
shouldBeTrue(curr->rtt == nullptr, curr, "non-cast BrOn must not have rtt");
}
+ noteBreak(curr->name, curr->getSentType(), curr);
}
void FunctionValidator::visitRttCanon(RttCanon* curr) {