summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-03-16 16:44:01 -0700
committerGitHub <noreply@github.com>2021-03-16 16:44:01 -0700
commit39eac740cdf769b30e9969824387bf8b4b025aab (patch)
tree9b0fd1ea6e3f667ff5c9877314544aa747b43ce7 /src/wasm/wasm-validator.cpp
parent661ae32122f9f0ba70b03b2d76a41274ce5e4bb2 (diff)
downloadbinaryen-39eac740cdf769b30e9969824387bf8b4b025aab.tar.gz
binaryen-39eac740cdf769b30e9969824387bf8b4b025aab.tar.bz2
binaryen-39eac740cdf769b30e9969824387bf8b4b025aab.zip
[Wasm GC] Validate static subtyping in rtt.sub (#3696)
Also add more spec tests, including one that verifies we validate rtt.sub and on a global location as fixed by #3694
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index a057f34b9..c7423ad6d 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2261,6 +2261,9 @@ void FunctionValidator::visitRttSub(RttSub* curr) {
curr,
"rtt.canon has a depth of 1 over the parent");
}
+ shouldBeTrue(HeapType::isSubType(rtt.heapType, parentRtt.heapType),
+ curr,
+ "rtt.sub parent must be a supertype");
}
}