blueloveTH 2 роки тому
батько
коміт
ab53927019
2 змінених файлів з 3 додано та 3 видалено
  1. 1 1
      include/pocketpy/error.h
  2. 2 2
      src/error.cpp

+ 1 - 1
include/pocketpy/error.h

@@ -24,7 +24,7 @@ enum CompileMode {
 };
 
 struct SourceData {
-    Str source;
+    std::string source;  // assume '\0' terminated
     Str filename;
     std::vector<const char*> line_starts;
     CompileMode mode;

+ 2 - 2
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;
     }