summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-03-20 15:52:19 -0700
committerAlon Zakai <azakai@google.com>2019-03-20 15:52:19 -0700
commit1690311955c5add86d634ecc47e937315b3b6c41 (patch)
tree429a0df2e87d41f46ed2408c90657b221294e22f /src/wasm/wasm-validator.cpp
parentfec88b85e44b49ac3273b0b7d4e06fba060df36f (diff)
parentfe0b16aa222318588f3bfd84e549b4a1528be296 (diff)
downloadbinaryen-1690311955c5add86d634ecc47e937315b3b6c41.tar.gz
binaryen-1690311955c5add86d634ecc47e937315b3b6c41.tar.bz2
binaryen-1690311955c5add86d634ecc47e937315b3b6c41.zip
Merge remote-tracking branch 'origin/master' into nans
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 84a0efbff..91e7e7398 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -1081,12 +1081,17 @@ void FunctionValidator::visitHost(Host* curr) {
}
void FunctionValidator::visitFunction(Function* curr) {
+ FeatureSet typeFeatures = getFeatures(curr->result);
for (auto type : curr->params) {
+ typeFeatures |= getFeatures(type);
shouldBeTrue(isConcreteType(type), curr, "params must be concretely typed");
}
for (auto type : curr->vars) {
+ typeFeatures |= getFeatures(type);
shouldBeTrue(isConcreteType(type), curr, "vars must be concretely typed");
}
+ shouldBeTrue(typeFeatures <= info.features, curr,
+ "all used types should be allowed");
// if function has no result, it is ignored
// if body is unreachable, it might be e.g. a return
if (curr->body->type != unreachable) {