blueloveTH há 2 anos atrás
pai
commit
ab53927019
2 ficheiros alterados com 3 adições e 3 exclusões
  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 {
 struct SourceData {
-    Str source;
+    std::string source;  // assume '\0' terminated
     Str filename;
     Str filename;
     std::vector<const char*> line_starts;
     std::vector<const char*> line_starts;
     CompileMode mode;
     CompileMode mode;

+ 2 - 2
src/error.cpp

@@ -14,8 +14,8 @@ namespace pkpy{
         }
         }
 
 
         this->filename = filename;
         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;
         this->mode = mode;
     }
     }