diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/fuzzing.h | 74 | ||||
-rw-r--r-- | src/tools/spec-wrapper.h | 2 | ||||
-rw-r--r-- | src/tools/wasm-ctor-eval.cpp | 3 | ||||
-rw-r--r-- | src/tools/wasm-reduce.cpp | 18 | ||||
-rw-r--r-- | src/tools/wasm-shell.cpp | 3 |
5 files changed, 50 insertions, 50 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 733029bd7..8de47900c 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -171,7 +171,7 @@ public: options.passes.push_back("vacuum"); break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected value"); } } if (oneIn(2)) { @@ -984,7 +984,7 @@ private: case 14: return makeUnreachable(unreachable); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected value"); } // make something with no chance of infinite recursion @@ -1334,7 +1334,7 @@ private: return builder.makeLoad( 4, signed_, offset, pick(1, 2, 4), ptr, type); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected value"); } case i64: { bool signed_ = get() & 1; @@ -1350,7 +1350,7 @@ private: return builder.makeLoad( 8, signed_, offset, pick(1, 2, 4, 8), ptr, type); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected value"); } case f32: { return builder.makeLoad(4, false, offset, pick(1, 2, 4), ptr, type); @@ -1369,9 +1369,9 @@ private: case exnref: // exnref cannot be loaded from memory case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } Expression* makeLoad(Type type) { @@ -1437,7 +1437,7 @@ private: return builder.makeStore( 4, offset, pick(1, 2, 4), ptr, value, type); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case i64: { switch (upTo(4)) { @@ -1452,7 +1452,7 @@ private: return builder.makeStore( 8, offset, pick(1, 2, 4, 8), ptr, value, type); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case f32: { return builder.makeStore(4, offset, pick(1, 2, 4), ptr, value, type); @@ -1471,9 +1471,9 @@ private: case exnref: // exnref cannot be stored in memory case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } Expression* makeStore(Type type) { @@ -1546,7 +1546,7 @@ private: return Literal( std::array<Literal, 2>{{makeLiteral(f64), makeLiteral(f64)}}); default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected value"); } } @@ -1567,7 +1567,7 @@ private: case exnref: // exnref cannot have literals case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } break; } @@ -1594,7 +1594,7 @@ private: small = uint32_t(get32()); break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } switch (type) { case i32: @@ -1610,7 +1610,7 @@ private: case exnref: // exnref cannot have literals case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -1676,7 +1676,7 @@ private: case exnref: // exnref cannot have literals case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } // tweak around special values if (oneIn(3)) { // +- 1 @@ -1708,7 +1708,7 @@ private: case exnref: // exnref cannot have literals case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } // maybe negative if (oneIn(2)) { @@ -1717,7 +1717,7 @@ private: return value; } } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalide value"); } Literal makeLiteral(Type type) { @@ -1816,9 +1816,9 @@ private: case exnref: // there's no unary ops for exnref case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } case i64: { switch (upTo(4)) { @@ -1856,7 +1856,7 @@ private: return buildUnary({op, make(f64)}); } } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case f32: { switch (upTo(4)) { @@ -1881,7 +1881,7 @@ private: case 3: return makeDeNanOp(buildUnary({DemoteFloat64, make(f64)})); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case f64: { switch (upTo(4)) { @@ -1906,7 +1906,7 @@ private: case 3: return makeDeNanOp(buildUnary({PromoteFloat32, make(f32)})); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case v128: { assert(wasm.features.hasSIMD()); @@ -1950,15 +1950,15 @@ private: WidenHighUVecI16x8ToVecI32x4), make(v128)}); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case anyref: // there's no unary ops for anyref case exnref: // there's no unary ops for exnref case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } Expression* buildBinary(const BinaryArgs& args) { @@ -2042,7 +2042,7 @@ private: make(f64), make(f64)}); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } case i64: { return buildBinary({pick(AddInt64, @@ -2189,9 +2189,9 @@ private: case exnref: // there's no binary ops for exnref case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } Expression* buildSelect(const ThreeArgs& args) { @@ -2292,7 +2292,7 @@ private: bytes = pick(1, 2, 4); break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalide value"); } break; } @@ -2311,12 +2311,12 @@ private: bytes = pick(1, 2, 4, 8); break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalide value"); } break; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } auto offset = logify(get()); auto* ptr = makePointer(); @@ -2362,7 +2362,7 @@ private: case 6: return makeSIMDLoad(); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } Expression* makeSIMDExtract(Type type) { @@ -2389,7 +2389,7 @@ private: case exnref: case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } Expression* vec = make(v128); uint8_t index = 0; @@ -2450,7 +2450,7 @@ private: lane_t = f64; break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected op"); } Expression* value = make(lane_t); return builder.makeSIMDReplace(op, vec, index, value); @@ -2551,7 +2551,7 @@ private: case 3: return makeMemoryFill(); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid value"); } Expression* makeMemoryInit() { @@ -2739,7 +2739,7 @@ private: } else if (auto* loop = target->dynCast<Loop>()) { return loop->name; } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected expr type"); } Type getTargetType(Expression* target) { @@ -2748,7 +2748,7 @@ private: } else if (target->is<Loop>()) { return none; } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected expr type"); } }; diff --git a/src/tools/spec-wrapper.h b/src/tools/spec-wrapper.h index 8dcb5fde4..bcdf2e113 100644 --- a/src/tools/spec-wrapper.h +++ b/src/tools/spec-wrapper.h @@ -52,7 +52,7 @@ static std::string generateSpecWrapper(Module& wasm) { case exnref: // there's no exnref.const case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } ret += " "; } diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index 34451b871..b45c624a4 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -231,7 +231,8 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface { } else if (segment.offset->is<GlobalGet>()) { start = 0; } else { - WASM_UNREACHABLE(); // wasm spec only allows const and global.get there + // wasm spec only allows const and global.get there + WASM_UNREACHABLE("invalid expr type"); } auto end = start + segment.data.size(); if (start <= index && index < end) { diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 0fe15b444..3e1e464f8 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -581,7 +581,7 @@ struct Reducer case i32: { switch (child->type) { case i32: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); case i64: fixed = builder->makeUnary(WrapInt64, child); break; @@ -597,7 +597,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -607,7 +607,7 @@ struct Reducer fixed = builder->makeUnary(ExtendSInt32, child); break; case i64: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); case f32: fixed = builder->makeUnary(TruncSFloat32ToInt64, child); break; @@ -620,7 +620,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -633,7 +633,7 @@ struct Reducer fixed = builder->makeUnary(ConvertSInt64ToFloat32, child); break; case f32: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); case f64: fixed = builder->makeUnary(DemoteFloat64, child); break; @@ -643,7 +643,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -659,14 +659,14 @@ struct Reducer fixed = builder->makeUnary(PromoteFloat32, child); break; case f64: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); case v128: case anyref: case exnref: continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -676,7 +676,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } assert(fixed->type == curr->type); if (tryToReplaceCurrent(fixed)) { diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp index f9efcd245..53436c9d3 100644 --- a/src/tools/wasm-shell.cpp +++ b/src/tools/wasm-shell.cpp @@ -84,8 +84,7 @@ struct Operation { } else if (operation == GET) { return instance->getExport(name); } else { - Fatal() << "unknown operation: " << operation << '\n'; - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unknown operation"); } } }; |