summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2022-08-11 17:56:49 -0700
committerGitHub <noreply@github.com>2022-08-11 17:56:49 -0700
commitdaf5447644e4b1c6c9c09fd0eec6f5ab983a6831 (patch)
treee6ad0637e3b6a306f41fb479f2c7ca52ad94f6c6 /src/wasm/wasm-validator.cpp
parent3bef680b3892c159ab30e6dd610de6f84c9556aa (diff)
downloadbinaryen-daf5447644e4b1c6c9c09fd0eec6f5ab983a6831.tar.gz
binaryen-daf5447644e4b1c6c9c09fd0eec6f5ab983a6831.tar.bz2
binaryen-daf5447644e4b1c6c9c09fd0eec6f5ab983a6831.zip
[EH] Pop should be supertype of tag type (#4901)
`pop`s type should be a supertype, not a subtype, of the tag's type within `catch`.
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 bc51d8b63..10310f8c0 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2175,7 +2175,7 @@ void FunctionValidator::visitTry(Try* curr) {
} else {
if (shouldBeTrue(pops.size() == 1, curr, "")) {
auto* pop = *pops.begin();
- if (!shouldBeSubType(pop->type, tag->sig.params, curr, "")) {
+ if (!shouldBeSubType(tag->sig.params, pop->type, curr, "")) {
getStream()
<< "catch's tag (" << tagName
<< ")'s pop doesn't have the same type as the tag's params";