From patchwork Tue Jan 7 13:44:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 1218790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-516794-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=golang.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LwjKNwwo"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=golang-org.20150623.gappssmtp.com header.i=@golang-org.20150623.gappssmtp.com header.b="cJSRrJQ6"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47sYXZ6KJHz9sR1 for ; Wed, 8 Jan 2020 00:45:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=MVPeKaBGvMv3m1wWUXE9NmREDfSBCOUTDq8f3eIRqEThMw NCK+Nd6R2c2JQxR5MAQcCc/9eQ+FR9SQ/2XmT1ht/XCc0NhbAvRoXvpjXE8pQPaG xGKDXXCMp9XTiYbgSrPPG4vs2UaLNtr+KxHb7Ng3DZOrYr1+OuoRou8TrHDd4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=9akFAUho0gDfwOK8Ncjl6mUo6b8=; b=LwjKNwwozv1XQblWNDSb p7r70ijYC0Ipk5To0zwIgcR6p1eBsr6YnlbR5IGPsXukHhRgX3NWSPLIn1YUMn9t 7f9kucqJevw/IuqBEWTf788aLwGljgXUvGOf0g8NsGz+uNdFtV67+H6geTtaSzrz cXr5gVQtRG172eEv0KPWoqM= Received: (qmail 3835 invoked by alias); 7 Jan 2020 13:44:55 -0000 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 Received: (qmail 3827 invoked by uid 89); 7 Jan 2020 13:44:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HTo:D*googlegroups.com, H*Ad:D*googlegroups.com X-HELO: mail-ed1-f51.google.com Received: from mail-ed1-f51.google.com (HELO mail-ed1-f51.google.com) (209.85.208.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Jan 2020 13:44:52 +0000 Received: by mail-ed1-f51.google.com with SMTP id c26so50363976eds.8 for ; Tue, 07 Jan 2020 05:44:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golang-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=+iFsmYcj4Ktna0+9P8c0xhco/WPukXYDA+8F+MnuNEs=; b=cJSRrJQ6P84vjGxXe13xXiWw+SaIKwOiyQUouFV8NgbxMRiQNguFbu2OXm66Fr7VcS tMl1nkYmNZwDnHvFv0583RKq+YxSO1rokYf+hOQHgpejA9uJ9IaUg1J7oUBK4CMXLLMq SIqzIVqJxqf8FxSuH3XfGtxJqBFN5rlDJy7crIPWX5W7dRtrgIaNiGMomTfUDqIAi2DE itBiPXqv4lHIhvp0H4fYICBvZbqFjWAipi4F6m4cKcM/hdx/cAUktWkvVE39KBAA6NAG r9TJd11i8EEBPqhyfwwVgnLgXVen3BxfVFGGHQGuur6FCU+UMVydC3M4NLNI0XP2vEOm +tJg== MIME-Version: 1.0 From: Ian Lance Taylor Date: Tue, 7 Jan 2020 05:44:38 -0800 Message-ID: Subject: Go patch committed: Avoid a couple of compiler crashes To: gcc-patches , gofrontend-dev This patch to the Go frontend avoids a couple of compiler crashes. These came up while building 1.14beta1 while the code was still invalid. The general policy is to not bother committing invalid test cases that cause compiler crashes. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 279848) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -9163fa28b89222cd851c0d24bd6a1384d1379c55 +d0a102eea2262e3fca89b1eb342fd03328c4aa16 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/expressions.cc =================================================================== --- gcc/go/gofrontend/expressions.cc (revision 279847) +++ gcc/go/gofrontend/expressions.cc (working copy) @@ -11766,10 +11766,17 @@ Call_expression::do_add_conversions() Typed_identifier_list::const_iterator pp = fntype->parameters()->begin(); bool is_interface_method = this->fn_->interface_field_reference_expression() != NULL; + size_t argcount = this->args_->size(); if (!is_interface_method && fntype->is_method()) { // Skip the receiver argument, which cannot be interface. pa++; + argcount--; + } + if (argcount != fntype->parameters()->size()) + { + go_assert(saw_errors()); + return; } for (; pa != this->args_->end(); ++pa, ++pp) { @@ -11895,6 +11902,8 @@ Call_expression::is_erroneous_call() Type* Call_expression::do_type() { + if (this->is_error_expression()) + return Type::make_error_type(); if (this->type_ != NULL) return this->type_;