From patchwork Wed Dec 22 06:37:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 76365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 52BFEB70A3 for ; Wed, 22 Dec 2010 17:37:46 +1100 (EST) Received: (qmail 14646 invoked by alias); 22 Dec 2010 06:37:45 -0000 Received: (qmail 14638 invoked by uid 22791); 22 Dec 2010 06:37:44 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 06:37:36 +0000 Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id oBM6bYtv014773 for ; Tue, 21 Dec 2010 22:37:34 -0800 Received: from pxi20 (pxi20.prod.google.com [10.243.27.20]) by hpaq11.eem.corp.google.com with ESMTP id oBM6bWJV021511 for ; Tue, 21 Dec 2010 22:37:33 -0800 Received: by pxi20 with SMTP id 20so1348730pxi.10 for ; Tue, 21 Dec 2010 22:37:32 -0800 (PST) Received: by 10.142.148.3 with SMTP id v3mr5326958wfd.266.1292999852196; Tue, 21 Dec 2010 22:37:32 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id w14sm8671781wfd.6.2010.12.21.22.37.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Dec 2010 22:37:31 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Correct test for number of args to append Date: Tue, 21 Dec 2010 22:37:29 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 -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;