Bug fix in CFG construction: VisitCompoundStmt should return the last created block.

llvm-svn: 48460
This commit is contained in:
Ted Kremenek 2008-03-17 17:19:44 +00:00
parent cf87e71053
commit fff4fc7e6d
1 changed files with 4 additions and 2 deletions

View File

@ -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) {