diff options
Diffstat (limited to 'lib/Checker/GRCoreEngine.cpp')
-rw-r--r-- | lib/Checker/GRCoreEngine.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/Checker/GRCoreEngine.cpp b/lib/Checker/GRCoreEngine.cpp index 01d254c8f4..c77a0228e4 100644 --- a/lib/Checker/GRCoreEngine.cpp +++ b/lib/Checker/GRCoreEngine.cpp @@ -233,9 +233,9 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps, break; default: - assert(isa<PostStmt>(Node->getLocation())); - HandlePostStmt(cast<PostStmt>(Node->getLocation()), WU.getBlock(), - WU.getIndex(), Node); + assert(isa<PostStmt>(Node->getLocation()) || + isa<PostInitializer>(Node->getLocation())); + HandlePostStmt(WU.getBlock(), WU.getIndex(), Node); break; } } @@ -413,9 +413,8 @@ void GRCoreEngine::HandleBranch(const Stmt* Cond, const Stmt* Term, ProcessBranch(Cond, Term, Builder); } -void GRCoreEngine::HandlePostStmt(const PostStmt& L, const CFGBlock* B, - unsigned StmtIdx, ExplodedNode* Pred) { - +void GRCoreEngine::HandlePostStmt(const CFGBlock* B, unsigned StmtIdx, + ExplodedNode* Pred) { assert (!B->empty()); if (StmtIdx == B->size()) @@ -473,6 +472,12 @@ void GRStmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) { return; } + // Do not create extra nodes. Move to the next CFG element. + if (isa<PostInitializer>(N->getLocation())) { + Eng.WList->Enqueue(N, &B, Idx+1); + return; + } + PostStmt Loc(getStmt(), N->getLocationContext()); if (Loc == N->getLocation()) { |