From patchwork Sun Apr 19 13:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1272894 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=2620:52:3:1:0:246e:9693:128c; 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=fae/pdTc; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 494rRz2Tdlz9s71 for ; Sun, 19 Apr 2020 23:35:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47CF3385DC34; Sun, 19 Apr 2020 13:35:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47CF3385DC34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587303318; bh=rZnZX3ONrSagYoleRhiIU9wX+aSSlXFSvPgon2oD124=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fae/pdTcK+jVYfOQExyjI/c2sAUxOBnHEWeZy8mchxTGJS6K2r+++UopUlM38hrj+ uZQzM9JUmJeuecCDZ47db7kHigZjKLVv5e6aQjQJpKECKFF6RfNvsi90M7Dh7dtGgZ Zmx3cplw5bWlqE3XaCjyIzw3h2CqE2nl8AgWrY0Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050::465:103]) by sourceware.org (Postfix) with ESMTPS id 83229385DC25 for ; Sun, 19 Apr 2020 13:35:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 83229385DC25 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 494rRk2FL6zKmL5; Sun, 19 Apr 2020 15:35:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id nrytekwsYd1n; Sun, 19 Apr 2020 15:35:11 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed 1/2] d/dmd: Merge upstream dmd 09be6ee14 (PR94653) Date: Sun, 19 Apr 2020 15:35:01 +0200 Message-Id: <20200419133501.7922-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6F6CE17EF 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 09be6ee14. Initializes ncost before use, which was caught by valgrind, fixing PR94653. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/dmd/MERGE | 2 +- gcc/d/dmd/root/speller.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index dc9fb1b8d97..2922939a2da 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -799066f498aebcfa420df284cac1f204b1f953a8 +09be6ee1439ba12211678f3f1b591d1e986b7be0 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/root/speller.c b/gcc/d/dmd/root/speller.c index 2a2e6c015c1..e04ffb38067 100644 --- a/gcc/d/dmd/root/speller.c +++ b/gcc/d/dmd/root/speller.c @@ -58,7 +58,7 @@ void *spellerY(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg, memcpy(buf, seed, index); *cost = INT_MAX; void* p = NULL; - int ncost; + int ncost = 0; /* Delete at seed[index] */ if (index < seedlen) @@ -122,7 +122,7 @@ void *spellerX(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg, if (!buf) return NULL; // no matches } - int cost = INT_MAX, ncost; + int cost = INT_MAX, ncost = 0; void *p = NULL, *np; /* Deletions */