blocks involving only ';' statements. We now correctly handle the following:
void empty_label() { l1: ; }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41619
91177308-0d34-0410-b5e6-
96231b3b80d8
CFGBlock* CFGBuilder::VisitLabelStmt(LabelStmt* L) {
// Get the block of the labeled statement. Add it to our map.
CFGBlock* LabelBlock = Visit(L->getSubStmt());
- assert (LabelBlock);
-
+
+ if (!LabelBlock) // This can happen when the body is empty, i.e.
+ LabelBlock=createBlock(); // scopes that only contains NullStmts.
+
assert (LabelMap.find(L) == LabelMap.end() && "label already in map");
LabelMap[ L ] = LabelBlock;