@@ -86,7 +86,7 @@ class Flow {
8686 }
8787
8888 Literals values;
89- Name breakTo; // if non-null, a break is going on
89+ Name breakTo; // if non-null, a break is going on
9090 Tag* suspendTag = nullptr ; // if non-null, breakTo must be SUSPEND_FLOW, and
9191 // this is the tag being suspended
9292
@@ -2689,9 +2689,9 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
26892689 return makeGCData (std::move (contents), curr->type );
26902690 }
26912691
2692- virtual void trap (const char * why) { WASM_UNREACHABLE (" unimp" ); }
2692+ virtual void trap (std::string_view why) { WASM_UNREACHABLE (" unimp" ); }
26932693
2694- virtual void hostLimit (const char * why) { WASM_UNREACHABLE (" unimp" ); }
2694+ virtual void hostLimit (std::string_view why) { WASM_UNREACHABLE (" unimp" ); }
26952695
26962696 virtual void throwException (const WasmException& exn) {
26972697 WASM_UNREACHABLE (" unimp" );
@@ -2924,9 +2924,11 @@ class ConstantExpressionRunner : public ExpressionRunner<SubType> {
29242924 Flow visitResumeThrow (ResumeThrow* curr) { return Flow (NONCONSTANT_FLOW); }
29252925 Flow visitStackSwitch (StackSwitch* curr) { return Flow (NONCONSTANT_FLOW); }
29262926
2927- void trap (const char * why) override { throw NonconstantException (); }
2927+ void trap (std::string_view why) override { throw NonconstantException (); }
29282928
2929- void hostLimit (const char * why) override { throw NonconstantException (); }
2929+ void hostLimit (std::string_view why) override {
2930+ throw NonconstantException ();
2931+ }
29302932
29312933 virtual void throwException (const WasmException& exn) override {
29322934 throw NonconstantException ();
@@ -2969,8 +2971,8 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
29692971 const Literal& value,
29702972 Index oldSize,
29712973 Index newSize) = 0;
2972- virtual void trap (const char * why) = 0;
2973- virtual void hostLimit (const char * why) = 0;
2974+ virtual void trap (std::string_view why) = 0;
2975+ virtual void hostLimit (std::string_view why) = 0;
29742976 virtual void throwException (const WasmException& exn) = 0;
29752977 // Get the Tag instance for a tag implemented in the host, that is, not
29762978 // among the linked ModuleRunner instances, but imported from the host.
@@ -4715,13 +4717,11 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
47154717 }
47164718 Flow visitStackSwitch (StackSwitch* curr) { return Flow (NONCONSTANT_FLOW); }
47174719
4718- void trap (const char * why) override {
4719- // Traps break all current continuations - they will never be resumable.
4720+ void trap (std::string_view why) {
47204721 self ()->clearContinuationStore ();
47214722 externalInterface->trap (why);
47224723 }
4723-
4724- void hostLimit (const char * why) override {
4724+ void hostLimit (std::string_view why) {
47254725 self ()->clearContinuationStore ();
47264726 externalInterface->hostLimit (why);
47274727 }
0 commit comments