From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id D42CA3858C1F; Tue, 3 Jan 2023 09:34:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D42CA3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672738474; bh=yWQGkfttN0yz8zc1lgvVor/1BVjjdzuUsBSExQGd6UY=; h=From:To:Subject:Date:From; b=LlYcLNegURVHOiJzANmC1Rkwa937BalWTAYm1Lcdw+rGrye2YLaKHS/D7DNRQjw1h MlTo6l2W5Z7r7Sfp1EAmFjWk9Ik4b6AkWziQscoCcyVGRTcU/iQD22jrovUgMbkMT+ TFwMhNpUIO/3LtcziScH9EuDekhm3OUqNTb/Kawg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4970] ada: Fix parsing bug in GNAT.Formatted_String X-Act-Checkin: gcc X-Git-Author: Ronan Desplanques X-Git-Refname: refs/heads/master X-Git-Oldrev: de77a81b2c974520183e6c2f205be54844f3d42e X-Git-Newrev: 7bad99da3d2a1511407136863918dabc009a7bbf Message-Id: <20230103093434.D42CA3858C1F@sourceware.org> Date: Tue, 3 Jan 2023 09:34:34 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7bad99da3d2a1511407136863918dabc009a7bbf commit r13-4970-g7bad99da3d2a1511407136863918dabc009a7bbf Author: Ronan Desplanques Date: Fri Dec 9 11:29:02 2022 +0100 ada: Fix parsing bug in GNAT.Formatted_String Before this patch, GNAT.Formatted_String.Formatted_String failed to handle format strings with two or more specifiers whose widths were specified with the "*" syntax. This patch makes the parser correctly reset its bits of state related to width and precision parsing when needed. gcc/ada/ * libgnat/g-forstr.adb (P_Int_Format): Fix parsing bug. Diff: --- gcc/ada/libgnat/g-forstr.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index 8353e2c4ad8..c9fb86b44f7 100644 --- a/gcc/ada/libgnat/g-forstr.adb +++ b/gcc/ada/libgnat/g-forstr.adb @@ -808,6 +808,7 @@ package body GNAT.Formatted_String is Format.D.Index := Start; return Format; end if; + Format.D.Stored_Value := 0; case F.Kind is when Unsigned_Octal =>