]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Unbounded string overriding control
authorDmitriy Anisimkov <anisimko@adacore.com>
Thu, 21 May 2020 12:15:40 +0000 (18:15 +0600)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 27 Jul 2020 08:05:19 +0000 (04:05 -0400)
commit21717db17a8264b7f75366aafa3d21afce5dd41b
tree332aae03e69a832aced097feff989258fe700c58
parent7f365be815ea6543ebfddb7d1688817cde5b223b
[Ada] Unbounded string overriding control

gcc/ada/

* libgnat/a-strunb.adb (Sum, Mul, Saturated_Sum, Saturated_Mul):
New routines.  Use them when resulting string size more that
length of the strings in parameters.
(Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side
of condition to avoid overflow.
* libgnat/a-strunb__shared.adb (Sum, Mul): New routines.
(Allocate): New routine with 2 parameters.  Use routine above
when resulting string size more that length of the strings in
parameters.
(Aligned_Max_Length): Do not try to align to more than Natural'Last.
(Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side
of condition to avoid overflow.
gcc/ada/libgnat/a-strunb.adb
gcc/ada/libgnat/a-strunb__shared.adb