summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2018-11-27 15:12:21 -0800
committerGitHub <noreply@github.com>2018-11-27 15:12:21 -0800
commit5d92d866d8326b1908328485cccd2f8ebe57ac75 (patch)
tree6f34e8815437b66c0ee083a61c1147a4257b68c6 /src/wasm/wasm-validator.cpp
parent70b949ffdc3e5f3fa83dd4044f632c95159674cf (diff)
downloadbinaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.tar.gz
binaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.tar.bz2
binaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.zip
Remove default cases (#1757)
Where reasonable from a readability perspective, remove default cases in switches over types and instructions. This makes future feature additions easier by making the compiler complain about each location where new types and instructions are not yet handled.
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 769f17d59..0b0d165ed 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -671,7 +671,7 @@ void FunctionValidator::visitBinary(Binary* curr) {
shouldBeEqualOrFirstIsUnreachable(curr->left->type, f64, curr, "f64 op");
break;
}
- default: WASM_UNREACHABLE();
+ case InvalidBinary: WASM_UNREACHABLE();
}
}
@@ -753,7 +753,7 @@ void FunctionValidator::visitUnary(Unary* curr) {
case DemoteFloat64: shouldBeEqual(curr->value->type, f64, curr, "demote type must be correct"); break;
case ReinterpretInt32: shouldBeEqual(curr->value->type, i32, curr, "reinterpret/i32 type must be correct"); break;
case ReinterpretInt64: shouldBeEqual(curr->value->type, i64, curr, "reinterpret/i64 type must be correct"); break;
- default: abort();
+ case InvalidUnary: WASM_UNREACHABLE();
}
}
@@ -790,7 +790,6 @@ void FunctionValidator::visitHost(Host* curr) {
break;
}
case CurrentMemory: break;
- default: WASM_UNREACHABLE();
}
}
@@ -863,7 +862,8 @@ void FunctionValidator::validateAlignment(size_t align, Type type, Index bytes,
shouldBeTrue(align <= 8, curr, "alignment must not exceed natural");
break;
}
- default: {}
+ case none:
+ case unreachable: {}
}
}