aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DereferenceChecker.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-14 12:08:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-11-14 12:08:24 +0000
commitd02e232c43b979758810794de24d3f5cde40fe93 (patch)
tree32a20b050ba1a7c26828bde07df0f8d8bd7355eb /lib/Analysis/DereferenceChecker.cpp
parent4fdba99ccce46d577ea1bcd5081843ef95ff5c11 (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 'lib/Analysis/DereferenceChecker.cpp')
-rw-r--r--lib/Analysis/DereferenceChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/DereferenceChecker.cpp b/lib/Analysis/DereferenceChecker.cpp
index 6fdad5d2a4..c3aa8f3a28 100644
--- a/lib/Analysis/DereferenceChecker.cpp
+++ b/lib/Analysis/DereferenceChecker.cpp
@@ -62,7 +62,7 @@ void DereferenceChecker::VisitLocation(CheckerContext &C, const Stmt *S,
BT_undef = new BuiltinBug("Dereference of undefined pointer value");
EnhancedBugReport *report =
- new EnhancedBugReport(*BT_undef, BT_undef->getDescription().c_str(), N);
+ new EnhancedBugReport(*BT_undef, BT_undef->getDescription(), N);
report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue,
bugreporter::GetDerefExpr(N));
C.EmitReport(report);
@@ -93,7 +93,7 @@ void DereferenceChecker::VisitLocation(CheckerContext &C, const Stmt *S,
"Dereference of null pointer");
EnhancedBugReport *report =
- new EnhancedBugReport(*BT_null, BT_null->getDescription().c_str(), N);
+ new EnhancedBugReport(*BT_null, BT_null->getDescription(), N);
report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue,
bugreporter::GetDerefExpr(N));