aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorClaire Dross <dross@adacore.com>2019-08-13 08:06:12 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-13 08:06:12 +0000
commitdfa6d55af715a2b902d6ed30f2c0276b1709dd5b (patch)
tree52f90b6e3841efddfc1e46959a7544fba543237b /gcc/ada
parentb9fb922ad7439b38119aaca7a38b839d62fcaf23 (diff)
downloadgcc-dfa6d55af715a2b902d6ed30f2c0276b1709dd5b.zip
gcc-dfa6d55af715a2b902d6ed30f2c0276b1709dd5b.tar.gz
gcc-dfa6d55af715a2b902d6ed30f2c0276b1709dd5b.tar.bz2
[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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/libgnat/a-cfinve.adb4
-rw-r--r--gcc/ada/libgnat/a-cofove.adb4
3 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e603f04..892cbbf 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/libgnat/a-cfinve.adb b/gcc/ada/libgnat/a-cfinve.adb
index 36df8e6..a187128 100644
--- a/gcc/ada/libgnat/a-cfinve.adb
+++ b/gcc/ada/libgnat/a-cfinve.adb
@@ -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
diff --git a/gcc/ada/libgnat/a-cofove.adb b/gcc/ada/libgnat/a-cofove.adb
index c848ad8..3a10d32 100644
--- a/gcc/ada/libgnat/a-cofove.adb
+++ b/gcc/ada/libgnat/a-cofove.adb
@@ -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