summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2013-03-13 17:07:32 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2013-03-13 17:07:32 +0000
commit6c2af439919b52121975ec5ea20ab1e359608918 (patch)
tree13c08da04026f476dc65d1d932a034078bd683a1 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parent9f2e0fa52e1e3249238288ede1b4c3eaefe8475e (diff)
downloadbcm5719-llvm-6c2af439919b52121975ec5ea20ab1e359608918.tar.gz
bcm5719-llvm-6c2af439919b52121975ec5ea20ab1e359608918.zip
[analyzer] fixed the logic changed by r176949
llvm-svn: 176956
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 5a02965a786..e88322ddf58 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -236,7 +236,7 @@ private:
void ReportUseAfterFree(CheckerContext &C, SourceRange Range,
SymbolRef Sym) const;
void ReportDoubleFree(CheckerContext &C, SourceRange Range, bool Released,
- SymbolRef Sym, bool Interesting) const;
+ SymbolRef Sym, SymbolRef PrevSym) const;
/// Find the location of the allocation for Sym on the path leading to the
/// exploded node N.
@@ -969,7 +969,7 @@ void MallocChecker::ReportUseAfterFree(CheckerContext &C, SourceRange Range,
void MallocChecker::ReportDoubleFree(CheckerContext &C, SourceRange Range,
bool Released, SymbolRef Sym,
- bool Interesting) const {
+ SymbolRef PrevSym) const {
if (ExplodedNode *N = C.generateSink()) {
if (!BT_DoubleFree)
@@ -980,8 +980,9 @@ void MallocChecker::ReportDoubleFree(CheckerContext &C, SourceRange Range,
: "Attempt to free non-owned memory"),
N);
R->addRange(Range);
- if (Interesting)
- R->markInteresting(Sym);
+ R->markInteresting(Sym);
+ if (PrevSym)
+ R->markInteresting(PrevSym);
R->addVisitor(new MallocBugVisitor(Sym));
C.emitReport(R);
}
OpenPOWER on IntegriCloud