Commit b5975ceb by Ian Lance Taylor

re PR go/61308 (gccgo: ICE in Expression::check_bounds [GoSmith])

	PR go/61308

compiler: Handle enclosing vars for function type in function lit.

This fixes a dumb bug in which the enclosing vars were
incorrectly cleared when a function literal contains a
reference to a function type.  The test for this will go into
the master repository in the change at
http://codereview.appspot.com/121200043 .

From-SVN: r213618
parent 6e4f9a95
......@@ -2870,7 +2870,10 @@ Parse::function_lit()
// For a function literal, the next token must be a '{'. If we
// don't see that, then we may have a type expression.
if (!this->peek_token()->is_op(OPERATOR_LCURLY))
return Expression::make_type(type, location);
{
hold_enclosing_vars.swap(this->enclosing_vars_);
return Expression::make_type(type, location);
}
bool hold_is_erroneous_function = this->is_erroneous_function_;
if (fntype_is_error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment