[llvm-branch-commits] [cfe-branch] r258715 - Merging r257947:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 25 12:35:13 PST 2016


Author: hans
Date: Mon Jan 25 14:35:13 2016
New Revision: 258715

URL: http://llvm.org/viewvc/llvm-project?rev=258715&view=rev
Log:
Merging r257947:
------------------------------------------------------------------------
r257947 | joerg | 2016-01-15 14:29:34 -0800 (Fri, 15 Jan 2016) | 2 lines

Avoid self-assignment of SmallString, trigger UB behavior down the road.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_38/   (props changed)
    cfe/branches/release_38/tools/driver/driver.cpp

Propchange: cfe/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 25 14:35:13 2016
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:257652,257695,258110
+/cfe/trunk:257652,257695,257947,258110
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_38/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/tools/driver/driver.cpp?rev=258715&r1=258714&r2=258715&view=diff
==============================================================================
--- cfe/branches/release_38/tools/driver/driver.cpp (original)
+++ cfe/branches/release_38/tools/driver/driver.cpp Mon Jan 25 14:35:13 2016
@@ -290,9 +290,9 @@ static void SetInstallDir(SmallVectorImp
   if (CanonicalPrefixes)
     llvm::sys::fs::make_absolute(InstalledPath);
 
-  InstalledPath = llvm::sys::path::parent_path(InstalledPath);
-  if (llvm::sys::fs::exists(InstalledPath.c_str()))
-    TheDriver.setInstalledDir(InstalledPath);
+  StringRef InstalledPathParent(llvm::sys::path::parent_path(InstalledPath));
+  if (llvm::sys::fs::exists(InstalledPathParent))
+    TheDriver.setInstalledDir(InstalledPathParent);
 }
 
 static int ExecuteCC1Tool(ArrayRef<const char *> argv, StringRef Tool) {




More information about the llvm-branch-commits mailing list