From patchwork Tue Apr 21 07:08:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1273996 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=r9vu9MNw; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 495vnC26bHz9sSW for ; Tue, 21 Apr 2020 17:09:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64BA0386F44E; Tue, 21 Apr 2020 07:08:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64BA0386F44E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587452938; bh=XZjtVAF1sI9WeoI1zwE+JWTcXpfABMFaDVamI/I4C7Y=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=r9vu9MNwD/qt1kpJhMBGwqLi/dLrVOXhjMKBBA7+PD1oOBUgbeRspF2/6sHCu1ubv vdGbD2vMZDOWI8N/CCw+NCivlvq0UMBTbDqEQhBWZeovEFTqKTRvivwAuC510+Loki s5QLZInXioFmBoKjwbXtUH8WojHctxI2GgVzP8co= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by sourceware.org (Postfix) with ESMTPS id EB14E386F425 for ; Tue, 21 Apr 2020 07:08:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB14E386F425 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 495vn21574zKmkY; Tue, 21 Apr 2020 09:08:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id NwyVXU9L3-vm; Tue, 21 Apr 2020 09:08:51 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d/dmd: Merge upstream dmd 62ce36f37 (PR94623) Date: Tue, 21 Apr 2020 09:08:44 +0200 Message-Id: <20200421070844.12932-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 47EAA17EF X-Rspamd-Score: 1.30 / 15.00 / 15.00 X-Spam-Status: No, score=-27.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch merges the D front-end implementation with dmd upstream 62ce36f37. Adjusts the hardcoded index of Error.bypassException. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain --- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/dinterpret.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index cd3d48ded8e..155286dd765 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -ba99ee345694da61eca7b555517d540ff3dc0a56 +62ce36f3737de691217c21f0173f411734eb1d43 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/dinterpret.c b/gcc/d/dmd/dinterpret.c index 61f5cdb0730..e2d49b9e8f1 100644 --- a/gcc/d/dmd/dinterpret.c +++ b/gcc/d/dmd/dinterpret.c @@ -1652,21 +1652,28 @@ public: { // Little sanity check to make sure it's really a Throwable ClassReferenceExp *boss = oldest->thrown; - assert((*boss->value->elements)[4]->type->ty == Tclass); // Throwable.next + const int next = 4; // index of Throwable.next + assert((*boss->value->elements)[next]->type->ty == Tclass); // Throwable.next ClassReferenceExp *collateral = newest->thrown; if ( isAnErrorException(collateral->originalClass()) && !isAnErrorException(boss->originalClass())) { + /* Find the index of the Error.bypassException field + */ + int bypass = next + 1; + if ((*collateral->value->elements)[bypass]->type->ty == Tuns32) + bypass += 1; // skip over _refcount field + assert((*collateral->value->elements)[bypass]->type->ty == Tclass); + // The new exception bypass the existing chain - assert((*collateral->value->elements)[5]->type->ty == Tclass); - (*collateral->value->elements)[5] = boss; + (*collateral->value->elements)[bypass] = boss; return newest; } - while ((*boss->value->elements)[4]->op == TOKclassreference) + while ((*boss->value->elements)[next]->op == TOKclassreference) { - boss = (ClassReferenceExp *)(*boss->value->elements)[4]; + boss = (ClassReferenceExp *)(*boss->value->elements)[next]; } - (*boss->value->elements)[4] = collateral; + (*boss->value->elements)[next] = collateral; return oldest; }