[llvm-branch-commits] [cfe-branch] r229746 - Merging r229719:
Hans Wennborg
hans at hanshq.net
Wed Feb 18 13:03:08 PST 2015
Author: hans
Date: Wed Feb 18 15:03:07 2015
New Revision: 229746
URL: http://llvm.org/viewvc/llvm-project?rev=229746&view=rev
Log:
Merging r229719:
------------------------------------------------------------------------
r229719 | d0k | 2015-02-18 10:45:54 -0800 (Wed, 18 Feb 2015) | 8 lines
Driver: Fix use of dangling std::string temporary
What's going on here is that the ternary operator produces a std::string rvalue
that the StringRef points to. I'd hoped bugs like this were a thing of the past
with our asan testing but apparently this code path is only used when LLVM is
configured with a custom --with-c-include-dirs setting.
Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely!
------------------------------------------------------------------------
Modified:
cfe/branches/release_36/ (props changed)
cfe/branches/release_36/lib/Driver/ToolChains.cpp
Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 18 15:03:07 2015
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227861,227979,228053,228464,228785,228792,229408
+/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227861,227979,228053,228464,228785,228792,229408,229719
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_36/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Driver/ToolChains.cpp?rev=229746&r1=229745&r2=229746&view=diff
==============================================================================
--- cfe/branches/release_36/lib/Driver/ToolChains.cpp (original)
+++ cfe/branches/release_36/lib/Driver/ToolChains.cpp Wed Feb 18 15:03:07 2015
@@ -3154,7 +3154,8 @@ void Linux::AddClangSystemIncludeArgs(co
SmallVector<StringRef, 5> dirs;
CIncludeDirs.split(dirs, ":");
for (StringRef dir : dirs) {
- StringRef Prefix = llvm::sys::path::is_absolute(dir) ? SysRoot : "";
+ StringRef Prefix =
+ llvm::sys::path::is_absolute(dir) ? StringRef(SysRoot) : "";
addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
}
return;
More information about the llvm-branch-commits
mailing list