From 967b254be1e60b4cb21c8e55a7f4b0346149b3ec Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 13 Dec 2014 01:41:49 +0000 Subject: [PATCH] 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 --- gcc/go/gofrontend/statements.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 5b8c2e73fc7..6094e5c684b 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -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); -- 2.30.2