From patchwork Thu Feb 10 23:07:39 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: 82681 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 EBFC4B70CD for ; Fri, 11 Feb 2011 10:07:50 +1100 (EST) Received: (qmail 13441 invoked by alias); 10 Feb 2011 23:07:49 -0000 Received: (qmail 13433 invoked by uid 22791); 10 Feb 2011 23:07: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, 10 Feb 2011 23:07:44 +0000 Received: from kpbe17.cbf.corp.google.com (kpbe17.cbf.corp.google.com [172.25.105.81]) by smtp-out.google.com with ESMTP id p1AN7gaW031014 for ; Thu, 10 Feb 2011 15:07:43 -0800 Received: from yxt3 (yxt3.prod.google.com [10.190.5.195]) by kpbe17.cbf.corp.google.com with ESMTP id p1AN7f65030876 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 10 Feb 2011 15:07:41 -0800 Received: by yxt3 with SMTP id 3so828760yxt.19 for ; Thu, 10 Feb 2011 15:07:41 -0800 (PST) Received: by 10.100.135.6 with SMTP id i6mr4584372and.41.1297379261276; Thu, 10 Feb 2011 15:07:41 -0800 (PST) Received: from coign.google.com (dhcp-172-22-125-221.mtv.corp.google.com [172.22.125.221]) by mx.google.com with ESMTPS id 37sm100963anr.24.2011.02.10.15.07.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Feb 2011 15:07:40 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't crash when referring to method without call Date: Thu, 10 Feb 2011 15:07:39 -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 when a method of an expression is referred to directly without calling it. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r aee4316d9007 go/expressions.cc --- a/go/expressions.cc Thu Feb 10 14:33:51 2011 -0800 +++ b/go/expressions.cc Thu Feb 10 15:04:01 2011 -0800 @@ -6397,7 +6397,8 @@ tree Bound_method_expression::do_get_tree(Translate_context*) { - gcc_unreachable(); + error_at(this->location(), "reference to method other than calling it"); + return error_mark_node; } // Make a method expression.