diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index f8e225540b..96e59f0f82 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -170,7 +170,7 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II, SourceLocation ColonLoc, StmtArg subStmt) { Stmt *SubStmt = static_cast<Stmt*>(subStmt.release()); // Look up the record for this label identifier. - LabelStmt *&LabelDecl = LabelMap[II]; + LabelStmt *&LabelDecl = CurBlock ? CurBlock->LabelMap[II] : LabelMap[II]; // If not forward referenced or defined already, just create a new LabelStmt. if (LabelDecl == 0) @@ -676,7 +676,8 @@ Sema::ActOnGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc, return StmtError(Diag(GotoLoc, diag::err_goto_in_block)); // Look up the record for this label identifier. - LabelStmt *&LabelDecl = LabelMap[LabelII]; + LabelStmt *&LabelDecl = CurBlock ? CurBlock->LabelMap[LabelII] : + LabelMap[LabelII]; // If we haven't seen this label yet, create a forward reference. if (LabelDecl == 0) |