From patchwork Fri Mar 24 21:14:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Anlauf X-Patchwork-Id: 74743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp24234vqo; Fri, 24 Mar 2023 14:15:55 -0700 (PDT) X-Google-Smtp-Source: AKy350aLcq/+8WmQd7329dKI7Jwyh6M/2JTeO2+vyV5ZK9wwp9xFB7H5Uvj1EfI2Kf9meLA4r0Lc X-Received: by 2002:a17:907:8c10:b0:928:c92e:d112 with SMTP id ta16-20020a1709078c1000b00928c92ed112mr4198523ejc.50.1679692555060; Fri, 24 Mar 2023 14:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679692555; cv=none; d=google.com; s=arc-20160816; b=ZR0zwVUKjoZ8UgEOXlnnQz9tccfvcQBSOavEYWpiMyPf8wRx+0YHZRtQ3lrnrJXwsT uHqIRJZDRIIHWr/3VPaVr6YkH57mIDJIHIquRNpfjOP7/gCfImbkDjZmR00FWk15YL1o wNMeZHIcq2t/VhmvMvFA0gUYtZljrkLh0jQT1o+lxh+MNKv3vyQmgPYMIXlvIQbJZ2v7 rU2AGSoafovdDZU2RyTuKYUgEgHZUlldJQKc8doLNdIA5UvVYtXp8O+spSFEeG+xTKqp fc+QpzC98EmK+GkrYh1GxhfsNp6ojO+DY6fe9gZ379QI8SuL70Xmc13e/SuV2NzooYbz tvCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:ui-outboundreport :sensitivity:importance:date:subject:to:message-id:mime-version :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=nLc2szwmess2Tc0dyRT14ndBt/3tXoTLtJMa4zy37Qk=; b=BsF85Rvex2M3NjrcYsGt1hm2mlKw8pueShHYn0y7PmuNMYRNB0IotXAzXVUGkDo99x yGccSbvv7gUKY5pcIB9w/1Mux9xRaK03mbDB+z+KeEzoRwBG7WUe2av0DBdR9WzchDVO Bl0qlWlYXz8eieYfZfMI8jPnNU7P/l8JQeCQ/1lN+8ZU6GazLkoaBPwHBtq+s1xs5d+2 D5hHSMK8SHyUcaMkcDjEky8zou0X1zZP8hcUz1fP/E44Jd0Mu8eI4KmJ/PKlh30ttykI /P12251aIiTlCeVMTb9q/a5DaOC+zU0nnf+tPRX1pkcNkhauGRTkEh6r5agZaVqkcLxe n8xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dPLbNaXN; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b5-20020a1709065e4500b009244d922f27si20743466eju.566.2023.03.24.14.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 14:15:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dPLbNaXN; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8ED6D385043C for ; Fri, 24 Mar 2023 21:15:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8ED6D385043C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679692553; bh=nLc2szwmess2Tc0dyRT14ndBt/3tXoTLtJMa4zy37Qk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dPLbNaXN3oCuTLNYLREF4y84W2W/uVt3D1yeRejDQwl5DzuN7W/QhWNMG/z08mXYJ G93rvM3d083OgnuYugtuEvNaqaFgqIltOhNIlCB5AfwTlBz90OZvx5BDemXIiU+nZi 5j69Hx6YtP4+rg32ca4Vhp44ojGZzZo3YWVatKB4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id 067BA385843A for ; Fri, 24 Mar 2023 21:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 067BA385843A X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [93.207.84.103] ([93.207.84.103]) by web-mail.gmx.net (3c-app-gmx-bap63.server.lan [172.19.172.133]) (via HTTP); Fri, 24 Mar 2023 22:14:55 +0100 MIME-Version: 1.0 Message-ID: To: fortran , gcc-patches Subject: [PATCH, committed] Fortran: fix FE memleak with BOZ expressions Date: Fri, 24 Mar 2023 22:14:55 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:G8frimf/8bpVQyYlB8XjjxxXE8MLV7FMLYx+fyjbgpqfLKUyYUPWbUVe6vT4FCMW1LEIy RmVYsyn7oSuk+n8AnYZBZcKWjLftMf4dRjkt0/7FHnUzTS5cNS0AMfgW0B0QRr4STTcFSpIqDjhC MXIrV35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am-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Harald Anlauf via Gcc-patches From: Harald Anlauf Reply-To: Harald Anlauf Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761285300646063467?= X-GMAIL-MSGID: =?utf-8?q?1761285300646063467?= Dear all, while looking at variations of testcases in pr107560, I discovered a minor FE memleak that was introduced in the BOZ rework and is fixed by the attached simple patch. Regtested on x86_64-pc-linux-gnu on OK'ed in the PR by Steve. Thanks, Harald From 833233a4aefc9981b671c1bda34676c20b76cc90 Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Fri, 24 Mar 2023 22:07:37 +0100 Subject: [PATCH] Fortran: fix FE memleak with BOZ expressions. gcc/fortran/ChangeLog: * expr.cc (free_expr0): Free also BOZ strings as part of an expression. --- gcc/fortran/expr.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc index 4662328bf31..7fb33f81788 100644 --- a/gcc/fortran/expr.cc +++ b/gcc/fortran/expr.cc @@ -466,6 +466,10 @@ free_expr0 (gfc_expr *e) mpc_clear (e->value.complex); break; + case BT_BOZ: + free (e->boz.str); + break; + default: break; } -- 2.35.3