@@ -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
@@ -2694,9 +2694,9 @@ class ExpressionRunner : public OverriddenVisitor<SubType, Flow> {
26942694 return makeGCData (std::move (contents), curr->type );
26952695 }
26962696
2697- virtual void trap (const char * why) { WASM_UNREACHABLE (" unimp" ); }
2697+ virtual void trap (std::string_view why) { WASM_UNREACHABLE (" unimp" ); }
26982698
2699- virtual void hostLimit (const char * why) { WASM_UNREACHABLE (" unimp" ); }
2699+ virtual void hostLimit (std::string_view why) { WASM_UNREACHABLE (" unimp" ); }
27002700
27012701 virtual void throwException (const WasmException& exn) {
27022702 WASM_UNREACHABLE (" unimp" );
@@ -2929,9 +2929,11 @@ class ConstantExpressionRunner : public ExpressionRunner<SubType> {
29292929 Flow visitResumeThrow (ResumeThrow* curr) { return Flow (NONCONSTANT_FLOW); }
29302930 Flow visitStackSwitch (StackSwitch* curr) { return Flow (NONCONSTANT_FLOW); }
29312931
2932- void trap (const char * why) override { throw NonconstantException (); }
2932+ void trap (std::string_view why) override { throw NonconstantException (); }
29332933
2934- void hostLimit (const char * why) override { throw NonconstantException (); }
2934+ void hostLimit (std::string_view why) override {
2935+ throw NonconstantException ();
2936+ }
29352937
29362938 virtual void throwException (const WasmException& exn) override {
29372939 throw NonconstantException ();
@@ -2974,8 +2976,8 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
29742976 const Literal& value,
29752977 Index oldSize,
29762978 Index newSize) = 0;
2977- virtual void trap (const char * why) = 0;
2978- virtual void hostLimit (const char * why) = 0;
2979+ virtual void trap (std::string_view why) = 0;
2980+ virtual void hostLimit (std::string_view why) = 0;
29792981 virtual void throwException (const WasmException& exn) = 0;
29802982 // Get the Tag instance for a tag implemented in the host, that is, not
29812983 // among the linked ModuleRunner instances, but imported from the host.
@@ -4741,13 +4743,12 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
47414743 Flow visitResumeThrow (ResumeThrow* curr) { return doResume (curr); }
47424744 Flow visitStackSwitch (StackSwitch* curr) { return Flow (NONCONSTANT_FLOW); }
47434745
4744- void trap (const char * why) override {
4746+ void trap (std::string_view why) override {
47454747 // Traps break all current continuations - they will never be resumable.
47464748 self ()->clearContinuationStore ();
47474749 externalInterface->trap (why);
47484750 }
4749-
4750- void hostLimit (const char * why) override {
4751+ void hostLimit (std::string_view why) override {
47514752 self ()->clearContinuationStore ();
47524753 externalInterface->hostLimit (why);
47534754 }
0 commit comments