summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-05-03 11:29:04 -0700
committerGitHub <noreply@github.com>2017-05-03 11:29:04 -0700
commitb6526bbfeb12a793654f918d142ba07852df69af (patch)
treeeacd81525ba79dcce02fadf9d336f0aea23e9bb6 /src/wasm-validator.h
parente10a6e22921889970ceb6e1fb76e786bc66d79d7 (diff)
parenta8f493f24d41295b63c6834fe8efb4996370fee5 (diff)
downloadbinaryen-b6526bbfeb12a793654f918d142ba07852df69af.tar.gz
binaryen-b6526bbfeb12a793654f918d142ba07852df69af.tar.bz2
binaryen-b6526bbfeb12a793654f918d142ba07852df69af.zip
Merge pull request #993 from WebAssembly/dce-types
Make use of unreachable type consistent
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 29787a510..b657b67a6 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -390,15 +390,7 @@ public:
}
void visitUnary(Unary *curr) {
shouldBeUnequal(curr->value->type, none, curr, "unaries must not receive a none as their input");
- switch (curr->op) {
- case EqZInt32:
- case EqZInt64: {
- shouldBeEqual(curr->type, i32, curr, "eqz must return i32");
- break;
- }
- default: {}
- }
- if (curr->value->type == unreachable) return;
+ if (curr->value->type == unreachable) return; // nothing to check
switch (curr->op) {
case ClzInt32:
case CtzInt32:
@@ -420,9 +412,7 @@ public:
case TruncFloat64:
case NearestFloat64:
case SqrtFloat64: {
- if (curr->value->type != unreachable) {
- shouldBeEqual(curr->value->type, curr->type, curr, "non-conversion unaries must return the same type");
- }
+ shouldBeEqual(curr->value->type, curr->type, curr, "non-conversion unaries must return the same type");
break;
}
case EqZInt32: {