From a716d7a575c55805c4b90e07cccf61b9cc0960b8 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 17 Mar 2008 17:19:44 +0000 Subject: [PATCH] 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 --- lib/AST/CFG.cpp | 6 ++++-- 1 file 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) { -- 2.40.0