summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-09 13:47:17 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:54:58 -0700
commit08293f0f451b398d3fa816c4d1bc6c87bbe6f102 (patch)
tree2225b6bfc5afc562fe77f4f7ed459d2e4f41cc7a
parentaf7985c92a79f46eb1e10cd2964ad03c581e745e (diff)
downloadbinaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.tar.gz
binaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.tar.bz2
binaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.zip
ignore unused return values in functions
-rw-r--r--src/wasm-validator.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index afa7b5d9c..b4d604c2c 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -339,8 +339,10 @@ public:
if (curr->body->type != unreachable) {
shouldBeEqual(curr->result, curr->body->type, curr->body, "function body type must match, if function returns");
}
- if (returnType != unreachable) {
- shouldBeEqual(curr->result, returnType, curr->body, "function result must match, if function returns");
+ if (curr->result != none) { // TODO: over previous too?
+ if (returnType != unreachable) {
+ shouldBeEqual(curr->result, returnType, curr->body, "function result must match, if function returns");
+ }
}
returnType = unreachable;
}