[cfe-commits] r138497 - /cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp

Anna Zaks ganna at apple.com
Wed Aug 24 14:58:55 PDT 2011


Author: zaks
Date: Wed Aug 24 16:58:55 2011
New Revision: 138497

URL: http://llvm.org/viewvc/llvm-project?rev=138497&view=rev
Log:
[analyzer] Do not use references in std::pair.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp?rev=138497&r1=138496&r2=138497&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp Wed Aug 24 16:58:55 2011
@@ -62,7 +62,7 @@
   void checkEndPath(EndOfFunctionNodeBuilder &B, ExprEngine &Eng) const;
 
 private:
-  typedef std::pair<SymbolRef, const AllocationState&> AllocationPair;
+  typedef std::pair<SymbolRef, const AllocationState*> AllocationPair;
   typedef llvm::SmallVector<AllocationPair, 2> AllocationPairVec;
 
   enum APIKind {
@@ -504,7 +504,7 @@
 BugReport *MacOSKeychainAPIChecker::
   generateAllocatedDataNotReleasedReport(const AllocationPair &AP,
                                          ExplodedNode *N) const {
-  const ADFunctionInfo &FI = FunctionsToTrack[AP.second.AllocatorIdx];
+  const ADFunctionInfo &FI = FunctionsToTrack[AP.second->AllocatorIdx];
   initBugType();
   llvm::SmallString<70> sbuf;
   llvm::raw_svector_ostream os(sbuf);
@@ -537,7 +537,7 @@
     if (State->getSymVal(I->first) ||
         definitelyReturnedError(I->second.RetValue, State, C.getSValBuilder()))
       continue;
-    Errors.push_back(std::make_pair(I->first, I->second));
+    Errors.push_back(std::make_pair(I->first, &I->second));
   }
   if (!Changed)
     return;
@@ -576,7 +576,7 @@
                                 Eng.getSValBuilder())) {
       continue;
     }
-    Errors.push_back(std::make_pair(I->first, I->second));
+    Errors.push_back(std::make_pair(I->first, &I->second));
   }
 
   // If no change, do not generate a new state.





More information about the cfe-commits mailing list