diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-08-21 22:28:32 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-08-21 22:28:32 +0000 |
| commit | 14536f6ee01a9c0381d1e905c43a8b714ddfb030 (patch) | |
| tree | f4058d96c5a49f263d48a811ed03e557b0ccd6a0 /clang/lib/Analysis/CheckNSError.cpp | |
| parent | 25e8e363dff82a06e0b9a19c33baf3ae3f2613e6 (diff) | |
| download | bcm5719-llvm-14536f6ee01a9c0381d1e905c43a8b714ddfb030.tar.gz bcm5719-llvm-14536f6ee01a9c0381d1e905c43a8b714ddfb030.zip | |
Add LocationContext* field to VarRegion. This is needed for interprocedural analysis.
llvm-svn: 79680
Diffstat (limited to 'clang/lib/Analysis/CheckNSError.cpp')
| -rw-r--r-- | clang/lib/Analysis/CheckNSError.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Analysis/CheckNSError.cpp b/clang/lib/Analysis/CheckNSError.cpp index f152d4451d8..800940dc614 100644 --- a/clang/lib/Analysis/CheckNSError.cpp +++ b/clang/lib/Analysis/CheckNSError.cpp @@ -42,7 +42,8 @@ class VISIBILITY_HIDDEN NSErrorCheck : public BugType { bool CheckNSErrorArgument(QualType ArgTy); bool CheckCFErrorArgument(QualType ArgTy); - void CheckParamDeref(VarDecl* V, const GRState *state, BugReporter& BR); + void CheckParamDeref(const VarDecl *V, const LocationContext *LC, + const GRState *state, BugReporter& BR); void EmitRetTyWarning(BugReporter& BR, const Decl& CodeDecl); @@ -94,8 +95,7 @@ void NSErrorCheck::FlushReports(BugReporter& BR) { // Scan the parameters for an implicit null dereference. for (llvm::SmallVectorImpl<VarDecl*>::iterator I=ErrorParams.begin(), E=ErrorParams.end(); I!=E; ++I) - CheckParamDeref(*I, (*RI)->getState(), BR); - + CheckParamDeref(*I, (*RI)->getLocationContext(), (*RI)->getState(), BR); } } @@ -191,10 +191,12 @@ bool NSErrorCheck::CheckCFErrorArgument(QualType ArgTy) { return TT->getDecl()->getIdentifier() == II; } -void NSErrorCheck::CheckParamDeref(VarDecl* Param, const GRState *rootState, +void NSErrorCheck::CheckParamDeref(const VarDecl *Param, + const LocationContext *LC, + const GRState *rootState, BugReporter& BR) { - SVal ParamL = rootState->getLValue(Param); + SVal ParamL = rootState->getLValue(Param, LC); const MemRegion* ParamR = cast<loc::MemRegionVal>(ParamL).getRegionAs<VarRegion>(); assert (ParamR && "Parameters always have VarRegions."); SVal ParamSVal = rootState->getSVal(ParamR); |

