From 942f7f5af30171ea44db18d93ea9e7d30eddc676 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 8 Dec 2014 18:05:30 +0000 Subject: [PATCH] re PR go/64198 (ICE in gofrontend) PR go/64198 compiler: Don't crash on invalid ++. From-SVN: r218485 --- gcc/go/gofrontend/parse.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 57310250c79..8e3aa3ba0fb 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -3190,9 +3190,12 @@ Parse::call(Expression* func) if (token->is_op(OPERATOR_COMMA)) token = this->advance_token(); if (!token->is_op(OPERATOR_RPAREN)) - error_at(this->location(), "missing %<)%>"); - else - this->advance_token(); + { + error_at(this->location(), "missing %<)%>"); + if (!this->skip_past_error(OPERATOR_RPAREN)) + return Expression::make_error(this->location()); + } + this->advance_token(); if (func->is_error_expression()) return func; return Expression::make_call(func, args, is_varargs, func->location()); -- 2.30.2