diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-11-14 12:08:24 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-11-14 12:08:24 +0000 |
commit | d02e232c43b979758810794de24d3f5cde40fe93 (patch) | |
tree | 32a20b050ba1a7c26828bde07df0f8d8bd7355eb /include/clang | |
parent | 4fdba99ccce46d577ea1bcd5081843ef95ff5c11 (diff) |
Change *BugReport constructors to take StringRefs.
- Eliminates many calls to std::string.c_str()
- Fixes an invalid read in ReturnStackAddressChecker due to an unsafe call to
StringRef.data() which doesn't guarantee null-termination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Analysis/PathSensitive/BugReporter.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 914118cb43..f4297350ec 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -81,10 +81,10 @@ public: getOriginalNode(const ExplodedNode* N) = 0; }; - BugReport(BugType& bt, const char* desc, const ExplodedNode *n) + BugReport(BugType& bt, llvm::StringRef desc, const ExplodedNode *n) : BT(bt), Description(desc), EndNode(n) {} - BugReport(BugType& bt, const char* shortDesc, const char* desc, + BugReport(BugType& bt, llvm::StringRef shortDesc, llvm::StringRef desc, const ExplodedNode *n) : BT(bt), ShortDescription(shortDesc), Description(desc), EndNode(n) {} @@ -193,11 +193,11 @@ public: class RangedBugReport : public BugReport { std::vector<SourceRange> Ranges; public: - RangedBugReport(BugType& D, const char* description, ExplodedNode *n) + RangedBugReport(BugType& D, llvm::StringRef description, ExplodedNode *n) : BugReport(D, description, n) {} - RangedBugReport(BugType& D, const char *shortDescription, - const char *description, ExplodedNode *n) + RangedBugReport(BugType& D, llvm::StringRef shortDescription, + llvm::StringRef description, ExplodedNode *n) : BugReport(D, shortDescription, description, n) {} ~RangedBugReport(); @@ -229,11 +229,11 @@ private: Creators creators; public: - EnhancedBugReport(BugType& D, const char* description, ExplodedNode *n) + EnhancedBugReport(BugType& D, llvm::StringRef description, ExplodedNode *n) : RangedBugReport(D, description, n) {} - EnhancedBugReport(BugType& D, const char *shortDescription, - const char *description, ExplodedNode *n) + EnhancedBugReport(BugType& D, llvm::StringRef shortDescription, + llvm::StringRef description, ExplodedNode *n) : RangedBugReport(D, shortDescription, description, n) {} ~EnhancedBugReport() {} |