From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31724 invoked by alias); 28 Jan 2020 08:28:07 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 31707 invoked by uid 89); 28 Jan 2020 08:28:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:2379883, H*f:sk:2379883, H*MI:sk:2379883, HContent-Transfer-Encoding:8bit X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Jan 2020 08:28:05 +0000 IronPort-SDR: cb7Wzdiz2gKbFy6M+Et3QRLR3omcwRGYyFClCVyPE2t4uIeG7qtj/6fgcxL7J6/eeYkz8wZYlx vBGIpHie3QtgTykDW40L0TVbNJsBMLe7RsMicODe+E2Y70gYZj9eHF+Q/ILW/ggZ82nromHluy 9oYXW2ZGN+CN6MIR9XedSJWsk2Xg6a+rfIVkMHX3qV/pAvlct+o2nUHuIHAjhJjPTnV9qKPVly 2MYdpnQ0rzvLkR1vXwJJR/ZnSlrV8Cz9hsX5yBnUyiyaljtkirBLHMo3hbDlwNyMsgpexZCCFF eWQ= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 28 Jan 2020 00:28:04 -0800 IronPort-SDR: juF3/Nl8n1Ol49V2DCoALY7E9o09cwZ9Ip3V9ctzf9TMeA89vKm7ixTklavxAbiJSEpk5mBYl4 OTL1URGnsdSw== Subject: Re: [patch, fortran] PR93473 - ICE on valid with long module + submodule names To: Andrew Benson , CC: References: <1642803.1Q0mUWRIpW@andrew-precision-3520> <5056833.bhCz5HFUgy@andrew-precision-3520> <2379883.S0vcn17Cz5@andrew-precision-3520> From: Tobias Burnus Message-ID: Date: Tue, 28 Jan 2020 08:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <2379883.S0vcn17Cz5@andrew-precision-3520> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit Return-Path: tobias@codesourcery.com X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00133.txt.bz2 On 1/28/20 12:41 AM, Andrew Benson wrote: > The problem occurs in set_syms_host_assoc() where the "parent1" and "parent2" > variables have a maximum length of GFC_MAX_SYMBOL_LEN+1. This is insufficient > when the parent names are a module+submodule name concatenated with a ".". The > patch above fixes this by increasing their length to 2*GFC_MAX_SYMBOL_LEN+2. > > A patch to fix this is attached. The patch regression tests cleanly - ok to > commit? The patch is okay, but can you add a comment – similar to the other patch – which makes clear why one needs twice the normal GFC_MAX_SYMBOL_LEN (+2)? You currently have: > const char dot[2] = "."; > - char parent1[GFC_MAX_SYMBOL_LEN + 1]; > - char parent2[GFC_MAX_SYMBOL_LEN + 1]; > + char parent1[2 * GFC_MAX_SYMBOL_LEN + 2]; > + char parent2[2 * GFC_MAX_SYMBOL_LEN + 2]; Tobias