diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-15 07:45:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-15 07:45:02 +0000 |
commit | cab47bdb378d3d17a4910bfde659ad0eb3c89285 (patch) | |
tree | d7c1022bc3b66a28da305e22ad1831784bd83a1d | |
parent | 322f055e0534533e00292096c569b047ff4e574c (diff) | |
download | bcm5719-llvm-cab47bdb378d3d17a4910bfde659ad0eb3c89285.tar.gz bcm5719-llvm-cab47bdb378d3d17a4910bfde659ad0eb3c89285.zip |
Small bug fix in CFG construction: the active block for LabelStmts comes
from "Block", not the CFGBlock* returned from visiting its subexpression.
llvm-svn: 48392
-rw-r--r-- | clang/AST/CFG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/AST/CFG.cpp b/clang/AST/CFG.cpp index 9bafb05daf4..e2aba6b3ff3 100644 --- a/clang/AST/CFG.cpp +++ b/clang/AST/CFG.cpp @@ -577,7 +577,8 @@ CFGBlock* CFGBuilder::VisitReturnStmt(ReturnStmt* R) { CFGBlock* CFGBuilder::VisitLabelStmt(LabelStmt* L) { // Get the block of the labeled statement. Add it to our map. - CFGBlock* LabelBlock = Visit(L->getSubStmt()); + Visit(L->getSubStmt()); + CFGBlock* LabelBlock = Block; if (!LabelBlock) // This can happen when the body is empty, i.e. LabelBlock=createBlock(); // scopes that only contains NullStmts. @@ -970,7 +971,7 @@ CFGBlock* CFGBuilder::VisitCaseStmt(CaseStmt* S) { // This block is now the implicit successor of other blocks. Succ = CaseBlock; - return CaseBlock; + return CaseBlock; } CFGBlock* CFGBuilder::VisitDefaultStmt(DefaultStmt* S) { |