浏览代码

FASTBuild: fix use-after-move

Since order of parameters' evaluation
is unspecified in C++, it might happen that
we move `val` before we call `substt()`.
Eduard Voronkin 1 月之前
父节点
当前提交
05360d19e9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Source/cmGlobalFastbuildGenerator.cxx

+ 2 - 2
Source/cmGlobalFastbuildGenerator.cxx

@@ -273,10 +273,10 @@ void cmGlobalFastbuildGenerator::ProcessEnvironment()
         LocalEnvironment.emplace_back(std::move(val));
       }
     };
-    for (auto& val : cmList{ EnvOverrides }) {
+    for (auto const& val : cmList{ EnvOverrides }) {
       auto const pos = val.find('=');
       if (pos != std::string::npos && ((pos + 1) < val.size())) {
-        overrideEnvVar(val.substr(0, pos + 1), std::move(val));
+        overrideEnvVar(val.substr(0, pos + 1), val);
       }
     }
   }