浏览代码

Update error.cpp

blueloveTH 2 年之前
父节点
当前提交
6028967abe
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/error.cpp

+ 1 - 1
src/error.cpp

@@ -13,7 +13,7 @@ namespace pkpy{
             index++;
         }
         this->source = ss.str();
-        if(this->source.sv().substr(5) == "pkpy:"){
+        if(this->source.size > 5 && this->source.sv().substr(0, 5) == "pkpy:"){
             this->is_precompiled = true;
         }else{
             this->is_precompiled = false;