diff mbox

Go patch committed: Correct test for number of args to append

Message ID mcrd3ouia8m.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 22, 2010, 6:37 a.m. UTC
This patch to the Go frontend corrects the test for the number of
arguments to the predeclared function append.  It must have at least two
arguments.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 9b8a9398feb4 go/expressions.cc
--- a/go/expressions.cc	Tue Dec 21 22:27:13 2010 -0800
+++ b/go/expressions.cc	Tue Dec 21 22:30:35 2010 -0800
@@ -7382,7 +7382,7 @@ 
     case BUILTIN_APPEND:
       {
 	const Expression_list* args = this->args();
-	if (args == NULL || args->empty())
+	if (args == NULL || args->size() < 2)
 	  {
 	    this->report_error(_("not enough arguments"));
 	    break;