diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2018-11-27 15:12:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 15:12:21 -0800 |
commit | 5d92d866d8326b1908328485cccd2f8ebe57ac75 (patch) | |
tree | 6f34e8815437b66c0ee083a61c1147a4257b68c6 /src/wasm-js.cpp | |
parent | 70b949ffdc3e5f3fa83dd4044f632c95159674cf (diff) | |
download | binaryen-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-js.cpp')
-rw-r--r-- | src/wasm-js.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp index 381487cd0..6e4b03aca 100644 --- a/src/wasm-js.cpp +++ b/src/wasm-js.cpp @@ -250,10 +250,12 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() { switch (type) { case none: return Literal(); case i32: return Literal((int32_t)ret); + case i64: WASM_UNREACHABLE(); case f32: return Literal((float)ret); case f64: return Literal((double)ret); - default: abort(); + case unreachable: WASM_UNREACHABLE(); } + WASM_UNREACHABLE(); } void importGlobals(std::map<Name, Literal>& globals, Module& wasm) override { |