From: NAKAMURA Takumi Date: Sat, 17 Mar 2012 13:06:05 +0000 (+0000) Subject: StaticAnalyzer: Fix abuse of StringRef in r152962. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fe4525680ce72e90cee3e58b5654e3ae955447f;p=clang StaticAnalyzer: Fix abuse of StringRef in r152962. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152982 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index 6460124b76..521b8999c4 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -443,7 +443,7 @@ public: /// Produce the hint for the given node. The node contains /// information about the call for which the diagnostic can be generated. - StringRef getCallStackMessage(const ExplodedNode *N) { + std::string getCallStackMessage(const ExplodedNode *N) { if (CallStackHint) return CallStackHint->getMessage(N); return ""; diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 363a6dffee..67dfcf51d2 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -395,7 +395,7 @@ static void updateStackPiecesWithMessage(PathDiagnosticPiece *P, E = CallStack.end(); I != E; ++I) { PathDiagnosticCallPiece *CP = I->first; const ExplodedNode *N = I->second; - StringRef stackMsg = ep->getCallStackMessage(N); + std::string stackMsg = ep->getCallStackMessage(N); // The last message on the path to final bug is the most important // one. Since we traverse the path backwards, do not add the message