[Ada] Extend range type in search primitives of formal vectors

2019-08-13  Claire Dross  <dross@adacore.com>

gcc/ada/

	* libgnat/a-cfinve.adb, libgnat/a-cofove.adb (Find_Index,
	Reverse_Find_Index): Use bigger type to avoid range check
	failure at the last loop iteration.

From-SVN: r274331
This commit is contained in:
Claire Dross 2019-08-13 08:06:12 +00:00 committed by Pierre-Marie de Rodat
parent b9fb922ad7
commit dfa6d55af7
3 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2019-08-13 Claire Dross <dross@adacore.com>
* libgnat/a-cfinve.adb, libgnat/a-cofove.adb (Find_Index,
Reverse_Find_Index): Use bigger type to avoid range check
failure at the last loop iteration.
2019-08-12 Dmitriy Anisimkov <anisimko@adacore.com>
* libgnat/g-socket.adb (Is_IPv6_Address): Check that no less

View File

@ -457,7 +457,7 @@ is
Item : Element_Type;
Index : Index_Type := Index_Type'First) return Extended_Index
is
K : Capacity_Range;
K : Count_Type;
Last : constant Index_Type := Last_Index (Container);
begin
@ -1277,7 +1277,7 @@ is
Index : Index_Type := Index_Type'Last) return Extended_Index
is
Last : Index_Type'Base;
K : Capacity_Range;
K : Count_Type'Base;
begin
if Index > Last_Index (Container) then

View File

@ -378,7 +378,7 @@ is
Item : Element_Type;
Index : Index_Type := Index_Type'First) return Extended_Index
is
K : Capacity_Range;
K : Count_Type;
Last : constant Index_Type := Last_Index (Container);
begin
@ -1147,7 +1147,7 @@ is
Index : Index_Type := Index_Type'Last) return Extended_Index
is
Last : Index_Type'Base;
K : Capacity_Range;
K : Count_Type'Base;
begin
if Index > Last_Index (Container) then