diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-17 17:19:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-17 17:19:44 +0000 |
commit | a716d7a575c55805c4b90e07cccf61b9cc0960b8 (patch) | |
tree | c713ef9ae6748b48dade3c03bc476bb3ad8e5020 /lib/AST/CFG.cpp | |
parent | 119c65d92beab2c75e14e087b8c170e8d307def4 (diff) |
Bug fix in CFG construction: VisitCompoundStmt should return the last created block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r-- | lib/AST/CFG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp index e2aba6b3ff..d8c5f1ce69 100644 --- a/lib/AST/CFG.cpp +++ b/lib/AST/CFG.cpp @@ -475,13 +475,15 @@ CFGBlock* CFGBuilder::VisitNullStmt(NullStmt* Statement) { } CFGBlock* CFGBuilder::VisitCompoundStmt(CompoundStmt* C) { + + CFGBlock* LastBlock = NULL; for (CompoundStmt::reverse_body_iterator I=C->body_rbegin(), E=C->body_rend(); I != E; ++I ) { - Visit(*I); + LastBlock = Visit(*I); } - return Block; + return LastBlock; } CFGBlock* CFGBuilder::VisitIfStmt(IfStmt* I) { |