From patchwork Tue Aug 28 05:35:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 180332 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 01D342C008F for ; Tue, 28 Aug 2012 15:36:10 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1346736971; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=kKm+SJI Q/u+Z32Lj9Mg6VbYhSzs=; b=kXHsDevhvE3jBNjGaKmVOCMz6CQrQAUvB3VBf6h WjCRHsbn0iEB8tXhRKCCSxfcLnhaHEZr8GHPJXt8T1EhlXT+2pozZCFrzdDhwngp iQNrgUrF6KXobCp4pai+7La7CJ4n2y6vAXDiEkoNjPw4BIz6uwPQu7EgD8Quin0Z GjV0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=AzNXK+eSDfKyBINTLFFVmcSb7EZ1rH3fvmb6yRmU7MsXR1yErmhZfckNG73x7I Fd5mLTyYnAz24Wn47DSp2JDTyRYLA62YNcItUwTIIUw0F5s8rxqFWECg5MS1QiHq yIhYGif1v4RREO0k91rQIl4MFt1WMV3EXcXTUjs1wBS7Q=; Received: (qmail 30000 invoked by alias); 28 Aug 2012 05:35:56 -0000 Received: (qmail 29968 invoked by uid 22791); 28 Aug 2012 05:35:55 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Aug 2012 05:35:38 +0000 Received: from [192.168.178.22] (port-92-204-67-8.dynamic.qsc.de [92.204.67.8]) by mx02.qsc.de (Postfix) with ESMTP id 0278127C7C; Tue, 28 Aug 2012 07:35:35 +0200 (CEST) Message-ID: <503C58A7.5030709@net-b.de> Date: Tue, 28 Aug 2012 07:35:35 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] Plug another memory leak 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 That's probably the last patch of this kind for a while. By using formal_ns, the namespace is freed when the main symbol is freed. Committed as Rev. Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 190737) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2012-08-28 Tobias Burnus + + PR fortran/54384 + * symbol.c (gfc_copy_formal_args): Set also sym->formal_ns. + 2012-08-27 Tobias Burnus PR fortran/54384 Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (Revision 190737) +++ gcc/fortran/symbol.c (Arbeitskopie) @@ -4103,6 +4103,7 @@ of the formal args). */ gfc_current_ns = gfc_get_namespace (parent_ns, 0); gfc_current_ns->proc_name = dest; + dest->formal_ns = gfc_current_ns; for (curr_arg = src->formal; curr_arg; curr_arg = curr_arg->next) {