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
This commit is contained in:
Ted Kremenek 2008-03-15 07:45:02 +00:00
parent 322f055e05
commit cab47bdb37
1 changed files with 3 additions and 2 deletions

View File

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