re PR go/61254 (gccgo: spurious "error: slice end must be integer" [GoSmith])

PR go/61254
compiler: Don't move nil subexpressions into temporaries.

From-SVN: r218701
This commit is contained in:
Ian Lance Taylor 2014-12-13 01:41:49 +00:00
parent e846322c86
commit 967b254be1

View File

@ -677,7 +677,8 @@ Move_subexpressions::expression(Expression** pexpr)
{ {
if (this->skip_ > 0) if (this->skip_ > 0)
--this->skip_; --this->skip_;
else if ((*pexpr)->temporary_reference_expression() == NULL) else if ((*pexpr)->temporary_reference_expression() == NULL
&& !(*pexpr)->is_nil_expression())
{ {
Location loc = (*pexpr)->location(); Location loc = (*pexpr)->location();
Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc); Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc);