From patchwork Thu Mar 3 06:50:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 85237 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 B8717B70E4 for ; Thu, 3 Mar 2011 17:50:52 +1100 (EST) Received: (qmail 1665 invoked by alias); 3 Mar 2011 06:50:49 -0000 Received: (qmail 1656 invoked by uid 22791); 3 Mar 2011 06:50:49 -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) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Mar 2011 06:50:43 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p236of9f028065 for ; Wed, 2 Mar 2011 22:50:41 -0800 Received: from iyj8 (iyj8.prod.google.com [10.241.51.72]) by wpaz17.hot.corp.google.com with ESMTP id p236oeXN000744 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 2 Mar 2011 22:50:40 -0800 Received: by iyj8 with SMTP id 8so767883iyj.31 for ; Wed, 02 Mar 2011 22:50:40 -0800 (PST) Received: by 10.42.151.73 with SMTP id d9mr1129511icw.238.1299135039961; Wed, 02 Mar 2011 22:50:39 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id z4sm658935ibg.1.2011.03.02.22.50.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 22:50:39 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't patch if type was not converted Date: Wed, 02 Mar 2011 22:50:36 -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 avoids a crash if an erroneous type was not converted to GENERIC. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r afb3d3196225 go/types.cc --- a/go/types.cc Wed Mar 02 22:39:25 2011 -0800 +++ b/go/types.cc Wed Mar 02 22:46:54 2011 -0800 @@ -7300,7 +7300,12 @@ // We are not converting types. This should only be called if the // type has already been converted. - gcc_assert(this->is_converted_); + if (!this->is_converted_) + { + gcc_assert(saw_errors()); + return error_mark_node; + } + gcc_assert(t != NULL_TREE && TYPE_SIZE(t) != NULL_TREE); // Complete the tree.