This patch fixes a bug in Put_Scaled, which causes a crash when checks
are on.
2019-08-12 Bob Duff <duff@adacore.com>
gcc/ada/
* libgnat/a-tifiio.adb (Put_Scaled): Prevent AA from being
negative, since Field is range 0 .. something.
From-SVN: r274300
+2019-08-12 Bob Duff <duff@adacore.com>
+
+ * libgnat/a-tifiio.adb (Put_Scaled): Prevent AA from being
+ negative, since Field is range 0 .. something.
+
2019-08-12 Bob Duff <duff@adacore.com>
* doc/gnat_ugn/gnat_utility_programs.rst (gnatmetric, gnatpp,
E : Integer)
is
pragma Assert (E >= -Max_Digits);
- AA : constant Field := E + A;
+ AA : constant Field := Integer'Max (E + A, 0);
N : constant Natural := (AA + Max_Digits - 1) / Max_Digits + 1;
Q : array (0 .. N - 1) of Int64 := (others => 0);