]> granicus.if.org Git - clang/commitdiff
Fixed iterator bug in ExplodedNodeImpl::NodeGroup::end(); we would improperly
authorTed Kremenek <kremenek@apple.com>
Wed, 16 Jan 2008 22:13:19 +0000 (22:13 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 16 Jan 2008 22:13:19 +0000 (22:13 +0000)
handle the case where the number of nodes was 0.

Fixed bug in GREngineImpl where we did not proceed to the next statement
when processing a PostStmt location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46093 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/ExplodedGraph.cpp
Analysis/GREngine.cpp

index 35e9d9de9a0ef5584cf4aa04869fd848778a7315..1cfb02c78777219f0a97daf68db7fe8a2e33b3c2 100644 (file)
@@ -60,7 +60,7 @@ ExplodedNodeImpl** ExplodedNodeImpl::NodeGroup::begin() const {
 
 ExplodedNodeImpl** ExplodedNodeImpl::NodeGroup::end() const {
   if (getKind() == Size1)
-    return ((ExplodedNodeImpl**) &P)+1;
+    return (ExplodedNodeImpl**) (P ? &P+1 : &P);
   else
     return const_cast<ExplodedNodeImpl**>(&*(getVector(getPtr()).rbegin())+1);
 }
index 42951fc24fd8690072841ee7763e488deba62bfa..f0c59cf93a50fa7a77342668b9ba3ff1dd02cef1 100644 (file)
@@ -167,7 +167,7 @@ void GREngineImpl::HandlePostStmt(const PostStmt& L, CFGBlock* B,
     HandleBlockExit(B, Pred);
   else {
     GRNodeBuilderImpl Builder(B, StmtIdx, Pred, this);
-    ProcessStmt(L.getStmt(), Builder);
+    ProcessStmt((*B)[StmtIdx], Builder);
   }
 }