Commit dfa6d55a by Claire Dross Committed by Pierre-Marie de Rodat

[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
parent b9fb922a
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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment