re PR go/61254 (gccgo: spurious "error: slice end must be integer" [GoSmith])
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 13 Dec 2014 01:41:49 +0000 (01:41 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 13 Dec 2014 01:41:49 +0000 (01:41 +0000)
PR go/61254
compiler: Don't move nil subexpressions into temporaries.

From-SVN: r218701

gcc/go/gofrontend/statements.cc

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