]> granicus.if.org Git - clang/commitdiff
[analyzer] fixed the logic changed by r176949
authorAnton Yartsev <anton.yartsev@gmail.com>
Wed, 13 Mar 2013 17:07:32 +0000 (17:07 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Wed, 13 Mar 2013 17:07:32 +0000 (17:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/MallocChecker.cpp

index 5a02965a786a3b53d415aa7681a02c244a421457..e88322ddf58e057e0b70d5514f7f7ff6f5dedf76 100644 (file)
@@ -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);
   }