diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-09 13:47:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:54:58 -0700 |
commit | 08293f0f451b398d3fa816c4d1bc6c87bbe6f102 (patch) | |
tree | 2225b6bfc5afc562fe77f4f7ed459d2e4f41cc7a /src | |
parent | af7985c92a79f46eb1e10cd2964ad03c581e745e (diff) | |
download | binaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.tar.gz binaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.tar.bz2 binaryen-08293f0f451b398d3fa816c4d1bc6c87bbe6f102.zip |
ignore unused return values in functions
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-validator.h | 6 |
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; } |