diff options
-rw-r--r-- | AST/CFG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/AST/CFG.cpp b/AST/CFG.cpp index 014dc861de..f6b74e7f7b 100644 --- a/AST/CFG.cpp +++ b/AST/CFG.cpp @@ -463,8 +463,10 @@ 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()); - 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; |