compiler: don't advance past unexpected semicolon
authorIan Lance Taylor <iant@golang.org>
Wed, 2 Dec 2020 03:15:57 +0000 (19:15 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 2 Dec 2020 15:47:06 +0000 (07:47 -0800)
We've already read the unexpected semicolon, so advancing again causes
us to skip the next token, causing future errors to be out of sync.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/274439

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/parse.cc

index 45f62b3bec5fc29f5785abbc80bd7766eea6b106..8cba9aa5a3d5a2f1f2a8663bfba4cd2b8125cb3c 100644 (file)
@@ -1,4 +1,4 @@
-2cc5c746ddfbaeb731f10f2232b9a488df12b71e
+81d3afed2b7f7eba4eed4599dfdd10081f67391e
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index c9a5485049fc04619575531b0489b87204ba93be..b062a471008aa7b99266d4df3d65481022ea70ed 100644 (file)
@@ -1567,7 +1567,6 @@ Parse::type_spec(void*, unsigned int pragmas)
       go_error_at(this->location(),
                  "unexpected semicolon or newline in type declaration");
       type = Type::make_error_type();
-      this->advance_token();
     }
 
   if (type->is_error_type())