From 7140ad92debc63af78a9c50dcad2a0b6d4ebc680 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 24 Apr 2018 11:57:02 +0000 Subject: [PATCH] [GCC] Don't keep a StringRef to a temporary std::string This fixes failures in asan builds and possibly other buildbots as well, after SVN r330696. Prior to that revision, the std::string was stored in another variable, before assigning to a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330710 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains/Gnu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp index 92c6a39887..39de858e11 100644 --- a/lib/Driver/ToolChains/Gnu.cpp +++ b/lib/Driver/ToolChains/Gnu.cpp @@ -1616,7 +1616,7 @@ Generic_GCC::GCCVersion Generic_GCC::GCCVersion::Parse(StringRef VersionText) { // 4.4.2-rc4 // 4.4.x-patched // And retains any patch number it finds. - StringRef PatchText = Second.second.str(); + StringRef PatchText = Second.second; if (!PatchText.empty()) { if (size_t EndNumber = PatchText.find_first_not_of("0123456789")) { // Try to parse the number and any suffix. -- 2.40.0