Skip to content

Commit

Permalink
Merging r257947:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
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.

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

llvm-svn: 258715
  • Loading branch information
zmodem committed Jan 25, 2016
1 parent cc2b411 commit 0c94351
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang/tools/driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ static void SetInstallDir(SmallVectorImpl<const char *> &argv,
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) {
Expand Down

0 comments on commit 0c94351

Please sign in to comment.