From 8c54c36bdf845cce69641c012e97ef30dc497369 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 16 Dec 2014 18:53:46 +0000 Subject: [PATCH] re PR go/61273 (gccgo: ICE in Unsafe_type_conversion_expression::do_get_backend [GoSmith]) PR go/61273 compiler: Send statements should contextually permit composite literals. From-SVN: r218788 --- gcc/go/gofrontend/parse.cc | 8 ++++---- gcc/go/gofrontend/parse.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 3b5ede542a5..a98dd479eb5 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -3819,7 +3819,7 @@ Parse::simple_stat(bool may_be_composite_lit, bool* return_exp, token = this->peek_token(); if (token->is_op(OPERATOR_CHANOP)) { - this->send_stmt(this->verify_not_sink(exp)); + this->send_stmt(this->verify_not_sink(exp), may_be_composite_lit); if (return_exp != NULL) *return_exp = true; } @@ -3913,13 +3913,13 @@ Parse::expression_stat(Expression* exp) // Channel = Expression . void -Parse::send_stmt(Expression* channel) +Parse::send_stmt(Expression* channel, bool may_be_composite_lit) { go_assert(this->peek_token()->is_op(OPERATOR_CHANOP)); Location loc = this->location(); this->advance_token(); - Expression* val = this->expression(PRECEDENCE_NORMAL, false, true, NULL, - NULL); + Expression* val = this->expression(PRECEDENCE_NORMAL, false, + may_be_composite_lit, NULL, NULL); Statement* s = Statement::make_send_statement(channel, val, loc); this->gogo_->add_statement(s); } diff --git a/gcc/go/gofrontend/parse.h b/gcc/go/gofrontend/parse.h index 3749645ebb3..d55798b6825 100644 --- a/gcc/go/gofrontend/parse.h +++ b/gcc/go/gofrontend/parse.h @@ -245,7 +245,7 @@ class Parse void statement_list(); bool statement_list_may_start_here(); void expression_stat(Expression*); - void send_stmt(Expression*); + void send_stmt(Expression*, bool may_be_composite_lit); void inc_dec_stat(Expression*); void assignment(Expression*, bool may_be_composite_lit, Range_clause*); void tuple_assignment(Expression_list*, bool may_be_composite_lit, -- 2.30.2