diff --git a/include/pocketpy/error.h b/include/pocketpy/error.h index 32c06da2..4fed1c1a 100644 --- a/include/pocketpy/error.h +++ b/include/pocketpy/error.h @@ -24,7 +24,7 @@ enum CompileMode { }; struct SourceData { - Str source; + std::string source; // assume '\0' terminated Str filename; std::vector line_starts; CompileMode mode; diff --git a/src/error.cpp b/src/error.cpp index 18d71c37..544f5cb8 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -14,8 +14,8 @@ namespace pkpy{ } this->filename = filename; - this->source = std::move(ss.str()); - line_starts.push_back(this->source.begin()); + this->source = ss.str().str(); + line_starts.push_back(this->source.c_str()); this->mode = mode; }