diff options
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp b/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp index a064a65b10..ab3242bdf5 100644 --- a/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp @@ -395,8 +395,7 @@ const MemRegion *IteratorsChecker::getRegion(const ProgramState *state, // with the same tag. void IteratorsChecker::checkExpr(CheckerContext &C, const Expr *E) const { const ProgramState *state = C.getState(); - const MemRegion *MR = getRegion(state, E, - C.getPredecessor()->getLocationContext()); + const MemRegion *MR = getRegion(state, E, C.getLocationContext()); if (!MR) return; @@ -466,7 +465,7 @@ void IteratorsChecker::checkPreStmt(const CallExpr *CE, void IteratorsChecker::checkPreStmt(const CXXOperatorCallExpr *OCE, CheckerContext &C) const { - const LocationContext *LC = C.getPredecessor()->getLocationContext(); + const LocationContext *LC = C.getLocationContext(); const ProgramState *state = C.getState(); OverloadedOperatorKind Kind = OCE->getOperator(); if (Kind == OO_Equal) { @@ -525,7 +524,7 @@ void IteratorsChecker::checkPreStmt(const DeclStmt *DS, // Get the MemRegion associated with the iterator and mark it as Undefined. const ProgramState *state = C.getState(); - Loc VarLoc = state->getLValue(VD, C.getPredecessor()->getLocationContext()); + Loc VarLoc = state->getLValue(VD, C.getLocationContext()); const MemRegion *MR = VarLoc.getAsRegion(); if (!MR) return; @@ -545,8 +544,7 @@ void IteratorsChecker::checkPreStmt(const DeclStmt *DS, E = M->GetTemporaryExpr(); if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) InitEx = ICE->getSubExpr(); - state = handleAssign(state, MR, InitEx, - C.getPredecessor()->getLocationContext()); + state = handleAssign(state, MR, InitEx, C.getLocationContext()); } } } |