aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2022-12-09 11:29:02 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-01-03 10:29:54 +0100
commit7bad99da3d2a1511407136863918dabc009a7bbf (patch)
tree71d86769dda4e2505ff9c55a6327d99daf13d38f
parentde77a81b2c974520183e6c2f205be54844f3d42e (diff)
downloadgcc-7bad99da3d2a1511407136863918dabc009a7bbf.zip
gcc-7bad99da3d2a1511407136863918dabc009a7bbf.tar.gz
gcc-7bad99da3d2a1511407136863918dabc009a7bbf.tar.bz2
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.
-rw-r--r--gcc/ada/libgnat/g-forstr.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb
index 8353e2c..c9fb86b 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 =>