changeset 51:c8f628ba8e9a

fix a incorrect if statement which causes incorrect goto parsing
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 14 Jan 2014 16:55:06 +0900
parents bd668f746740
children c22698ecb2a9
files tools/clang/lib/Parse/ParseStmt.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tools/clang/lib/Parse/ParseStmt.cpp	Tue Jan 14 16:42:07 2014 +0900
+++ b/tools/clang/lib/Parse/ParseStmt.cpp	Tue Jan 14 16:55:06 2014 +0900
@@ -260,10 +260,10 @@
 
   case tok::kw_goto:                // C99 6.8.6.1: goto-statement
 #ifndef noCbC
-    if (!(NextToken().is(tok::identifier) && PP.LookAhead(1).is(tok::colon)) && 
-	NextToken().isNot(tok::star)) { // CbC: goto codesegment statement
+    if (!(NextToken().is(tok::identifier) && PP.LookAhead(1).is(tok::semi)) && // C: 'goto' identifier ';'
+	NextToken().isNot(tok::star)) {                                        // C: 'goto' '*' expression ';'
       SemiError = "goto code segment";
-      return ParseCbCGotoStatement(Attrs, Stmts);
+      return ParseCbCGotoStatement(Attrs, Stmts);                              // CbC: goto codesegment statement
     }
 #endif
     Res = ParseGotoStatement();