aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-08-17 23:00:25 +0000
committerAnna Zaks <ganna@apple.com>2011-08-17 23:00:25 +0000
commite172e8b9e7fc67d7d03589af7e92fe777afcf33a (patch)
treedc6a082bd73ddc63c22c8e985bd3d997fc9aba65 /lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
parent59f9b26bcb59bfb4d66c6ea129172795dcd1cb6b (diff)
Remove EnhancedBugReport and RangedBugReport - pull all the extra functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
index 8470dc6272..ce149b003f 100644
--- a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
@@ -84,9 +84,8 @@ private:
BT.reset(new BugType("Improper use of SecKeychain API", "Mac OS API"));
}
- RangedBugReport *generateAllocatedDataNotReleasedReport(
- const AllocationState &AS,
- ExplodedNode *N) const;
+ BugReport *generateAllocatedDataNotReleasedReport(const AllocationState &AS,
+ ExplodedNode *N) const;
/// Check if RetSym evaluates to an error value in the current state.
bool definitelyReturnedError(SymbolRef RetSym,
@@ -245,7 +244,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
<< "the allocator: missing a call to '"
<< FunctionsToTrack[DIdx].Name
<< "'.";
- RangedBugReport *Report = new RangedBugReport(*BT, os.str(), N);
+ BugReport *Report = new BugReport(*BT, os.str(), N);
Report->addRange(ArgExpr->getSourceRange());
C.EmitReport(Report);
}
@@ -291,7 +290,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
if (!N)
return;
initBugType();
- RangedBugReport *Report = new RangedBugReport(*BT,
+ BugReport *Report = new BugReport(*BT,
"Trying to free data which has not been allocated.", N);
Report->addRange(ArgExpr->getSourceRange());
C.EmitReport(Report);
@@ -316,7 +315,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
llvm::raw_svector_ostream os(sbuf);
os << "Allocator doesn't match the deallocator: '"
<< FunctionsToTrack[PDeallocIdx].Name << "' should be used.";
- RangedBugReport *Report = new RangedBugReport(*BT, os.str(), N);
+ BugReport *Report = new BugReport(*BT, os.str(), N);
Report->addRange(ArgExpr->getSourceRange());
C.EmitReport(Report);
return;
@@ -328,7 +327,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
if (!N)
return;
initBugType();
- RangedBugReport *Report = new RangedBugReport(*BT,
+ BugReport *Report = new BugReport(*BT,
"Call to free data when error was returned during allocation.", N);
Report->addRange(ArgExpr->getSourceRange());
C.EmitReport(Report);
@@ -406,7 +405,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const ReturnStmt *S,
// TODO: The report has to mention the expression which contains the
// allocated content as well as the point at which it has been allocated.
-RangedBugReport *MacOSKeychainAPIChecker::
+BugReport *MacOSKeychainAPIChecker::
generateAllocatedDataNotReleasedReport(const AllocationState &AS,
ExplodedNode *N) const {
const ADFunctionInfo &FI = FunctionsToTrack[AS.AllocatorIdx];
@@ -415,7 +414,7 @@ RangedBugReport *MacOSKeychainAPIChecker::
llvm::raw_svector_ostream os(sbuf);
os << "Allocated data is not released: missing a call to '"
<< FunctionsToTrack[FI.DeallocatorIdx].Name << "'.";
- RangedBugReport *Report = new RangedBugReport(*BT, os.str(), N);
+ BugReport *Report = new BugReport(*BT, os.str(), N);
Report->addRange(AS.Address->getSourceRange());
return Report;
}