diff options
author | Anton Yartsev <anton.yartsev@gmail.com> | 2013-03-13 17:07:32 +0000 |
---|---|---|
committer | Anton Yartsev <anton.yartsev@gmail.com> | 2013-03-13 17:07:32 +0000 |
commit | 3258d4b3fb5922027747217e5e6f81a11878600d (patch) | |
tree | c0eeea2183a27a6fc537e3fbaa988d5d2e73c0ea /lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | b38b3cd64c24500cbea9e6dfe774407dd6ef4a79 (diff) |
[analyzer] fixed the logic changed by r176949
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 5a02965a78..e88322ddf5 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/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); } |