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 | f4c511b026a8c9d11392c5ce05ff0a6de28d8172 (patch) | |
tree | 73f8290ea8de557db9c0c4f5f83c08128af18340 /clang/lib/Analysis/FixedAddressChecker.cpp | |
parent | ea956ddf0b664de624b5ca046f5d9daf87ada727 (diff) | |
download | bcm5719-llvm-f4c511b026a8c9d11392c5ce05ff0a6de28d8172.tar.gz bcm5719-llvm-f4c511b026a8c9d11392c5ce05ff0a6de28d8172.zip |
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.
llvm-svn: 88779
Diffstat (limited to 'clang/lib/Analysis/FixedAddressChecker.cpp')
-rw-r--r-- | clang/lib/Analysis/FixedAddressChecker.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Analysis/FixedAddressChecker.cpp b/clang/lib/Analysis/FixedAddressChecker.cpp index e30e3d0ce1c..80096dcb70d 100644 --- a/clang/lib/Analysis/FixedAddressChecker.cpp +++ b/clang/lib/Analysis/FixedAddressChecker.cpp @@ -59,8 +59,7 @@ void FixedAddressChecker::PreVisitBinaryOperator(CheckerContext &C, "Using a fixed address is not portable because that " "address will probably not be valid in all " "environments or platforms."); - RangedBugReport *R = new RangedBugReport(*BT, BT->getDescription().c_str(), - N); + RangedBugReport *R = new RangedBugReport(*BT, BT->getDescription(), N); R->addRange(B->getRHS()->getSourceRange()); C.EmitReport(R); } |