From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16466 invoked by alias); 21 Dec 2010 22:33:23 -0000 Received: (qmail 16454 invoked by uid 22791); 21 Dec 2010 22:33:21 -0000 X-SWARE-Spam-Status: No, hits=-2.9 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; Tue, 21 Dec 2010 22:33:17 +0000 Received: from kpbe20.cbf.corp.google.com (kpbe20.cbf.corp.google.com [172.25.105.84]) by smtp-out.google.com with ESMTP id oBLMXDM7026764 for ; Tue, 21 Dec 2010 14:33:14 -0800 Received: from pzk30 (pzk30.prod.google.com [10.243.19.158]) by kpbe20.cbf.corp.google.com with ESMTP id oBLMXCqG003201 for ; Tue, 21 Dec 2010 14:33:12 -0800 Received: by pzk30 with SMTP id 30so1263791pzk.36 for ; Tue, 21 Dec 2010 14:33:12 -0800 (PST) Received: by 10.142.149.21 with SMTP id w21mr5029562wfd.168.1292970792152; Tue, 21 Dec 2010 14:33:12 -0800 (PST) Received: from coign.google.com (dhcp-172-22-122-207.mtv.corp.google.com [172.22.122.207]) by mx.google.com with ESMTPS id v19sm8159401wfh.12.2010.12.21.14.33.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Dec 2010 14:33:11 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't finalize methods more than once Date: Tue, 21 Dec 2010 22:53:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg01652.txt.bz2 --=-=-= Content-length: 258 This patch to the Go frontend prevents the compiler from trying to finalize the methods for a type more than once. This avoids an endless loop in an invalid case. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=foo.patch Content-Description: methods Content-length: 574 diff -r 7975dbfdedb1 go/types.cc --- a/go/types.cc Tue Dec 21 13:12:12 2010 -0800 +++ b/go/types.cc Tue Dec 21 14:29:10 2010 -0800 @@ -3698,6 +3698,8 @@ void Struct_type::finalize_methods(Gogo* gogo) { + if (this->all_methods_ != NULL) + return; Type::finalize_methods(gogo, this, this->location_, &this->all_methods_); } @@ -6615,6 +6617,9 @@ void Named_type::finalize_methods(Gogo* gogo) { + if (this->all_methods_ != NULL) + return; + if (this->local_methods_ != NULL && (this->points_to() != NULL || this->interface_type() != NULL)) { --=-=-=--