فهرست منبع

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);
       }
     }
   }