forked from OSchip/llvm-project
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:
parent
322f055e05
commit
cab47bdb37
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue