Skip to content

Commit

Permalink
[analyzer] Do not use references in std::pair.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138497 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
AnnaZaks committed Aug 24, 2011
1 parent c266de9 commit 5eb7d82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MacOSKeychainAPIChecker : public Checker<check::PreStmt<CallExpr>,
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 {
Expand Down Expand Up @@ -504,7 +504,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const ReturnStmt *S,
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);
Expand Down Expand Up @@ -537,7 +537,7 @@ void MacOSKeychainAPIChecker::checkDeadSymbols(SymbolReaper &SR,
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;
Expand Down Expand Up @@ -576,7 +576,7 @@ void MacOSKeychainAPIChecker::checkEndPath(EndOfFunctionNodeBuilder &B,
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.
Expand Down

0 comments on commit 5eb7d82

Please sign in to comment.