浏览代码

server-mode: Fix per-source COMPILE_FLAGS genex evaluation

Logic added by commit 1e4bb358 (Add generator expression support to
per-source COMPILE_FLAGS, 2016-10-25) accidentally frees memory before
finishing with it.  Revise the logic to hold the memory long enough.
Tobias Hunger 9 年之前
父节点
当前提交
5dec0a2328
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Source/cmServerProtocol.cxx

+ 2 - 1
Source/cmServerProtocol.cxx

@@ -688,8 +688,9 @@ static Json::Value DumpSourceFilesList(
       std::string compileFlags = ld.Flags;
       std::string compileFlags = ld.Flags;
       if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) {
       if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) {
         cmGeneratorExpression ge;
         cmGeneratorExpression ge;
+        auto cge = ge.Parse(cflags);
         const char* processed =
         const char* processed =
-          ge.Parse(cflags)->Evaluate(target->GetLocalGenerator(), config);
+          cge->Evaluate(target->GetLocalGenerator(), config);
         lg->AppendFlags(compileFlags, processed);
         lg->AppendFlags(compileFlags, processed);
       }
       }
       fileData.Flags = compileFlags;
       fileData.Flags = compileFlags;