From patchwork Wed Mar 7 16:06:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 145316 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 006EDB6EEA for ; Thu, 8 Mar 2012 03:06:38 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331741199; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=zyUtRErhkyxhb8UrwZ3PvQ46Ihg=; b=b3eFv8Q/JOmyizl H1A6K8MdFT4oF5/5mpNwwwFmAnC3DIJL9SkJpB1degloU8pa4hsoUnYQS6jTvJyQ szJke4nwyY+qaMDooBJw6i7N0D1tNFcdOFp0NJlC5p8CVlS4jhxA8xEf7YURs5V7 7L1o5EVxHJv9RWJV5P1KALM2AuBQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=PlQn6iLLKnGWkC5eDmVMs1weOm17ThAinDn2/FO4fzNnhrqdDVtQQ/CqJMvMDH LFeh6++pThBFbGAaDy9GyqmvoQaMz8FvFb/32mWTWxoZnOh8twptq5lwS4htAS9W pEJMWnX5A0rzPrNLbw41Rg/qw9ggLctiCLsBWEW5tu5z0=; Received: (qmail 4126 invoked by alias); 7 Mar 2012 16:06:31 -0000 Received: (qmail 4111 invoked by uid 22791); 7 Mar 2012 16:06:29 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Mar 2012 16:06:16 +0000 Received: by iaag37 with SMTP id g37so9046673iaa.20 for ; Wed, 07 Mar 2012 08:06:15 -0800 (PST) Received: by 10.50.89.229 with SMTP id br5mr2232548igb.19.1331136375619; Wed, 07 Mar 2012 08:06:15 -0800 (PST) Received: by 10.50.89.229 with SMTP id br5mr2232533igb.19.1331136375509; Wed, 07 Mar 2012 08:06:15 -0800 (PST) Received: from coign.google.com ([2620:0:1000:2301:f2de:f1ff:fe40:72a8]) by mx.google.com with ESMTPS id hy6sm12592280igc.12.2012.03.07.08.06.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Mar 2012 08:06:14 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Fix bug when struct inherits varargs Date: Wed, 07 Mar 2012 08:06:13 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl2wBJmSIcIyGgDRiF0GunSqDrh7QkMrvQq9B5WJiIhLRJCUcnxfMKwEjizkMUAizGviaZBuNhFTMzBPuVejMl0lv7APCvO06DjNBGlMUUhzBWMd7w1fHUGSdGUFy+FmGnxjO6fk5JVlYaIDqpQGw6nBenVRuAMwFLitsWFLsX4RETXjVQ= 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 compiler fixes a bug when a struct inherits from an interface with a varargs method. I added a test for this to the master Go testsuite, which will be copied into gcc in due course. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r e9c1caae3b22 go/types.cc --- a/go/types.cc Tue Mar 06 17:06:46 2012 -0800 +++ b/go/types.cc Wed Mar 07 08:03:33 2012 -0800 @@ -3744,8 +3744,12 @@ go_assert(!this->is_method()); Typed_identifier* receiver = new Typed_identifier("", receiver_type, this->location_); - return Type::make_function_type(receiver, this->parameters_, - this->results_, this->location_); + Function_type* ret = Type::make_function_type(receiver, this->parameters_, + this->results_, + this->location_); + if (this->is_varargs_) + ret->set_is_varargs(); + return ret; } // Make a function type.