aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-06-03 00:17:21 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-15 09:42:49 -0400
commit7fe05755eb49f2fd34ce0fe725978c7fadef8ee3 (patch)
treee119dec8033765498a87ffc9a5bd6860a77aa3a0
parent257baf5ab9693cded2273f32293fdc925aea35c0 (diff)
downloadgcc-7fe05755eb49f2fd34ce0fe725978c7fadef8ee3.zip
gcc-7fe05755eb49f2fd34ce0fe725978c7fadef8ee3.tar.gz
gcc-7fe05755eb49f2fd34ce0fe725978c7fadef8ee3.tar.bz2
[Ada] Fix for possibly null ranges in 'Update and delta_aggregate
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Apply scalar range checks against the base type of an index type, not against the index type itself.
-rw-r--r--gcc/ada/exp_spark.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb
index 40621bd..6454902 100644
--- a/gcc/ada/exp_spark.adb
+++ b/gcc/ada/exp_spark.adb
@@ -227,9 +227,9 @@ package body Exp_SPARK is
if Nkind (Index) = N_Range then
Apply_Scalar_Range_Check
- (Low_Bound (Index), Etype (Index_Typ));
+ (Low_Bound (Index), Base_Type (Etype (Index_Typ)));
Apply_Scalar_Range_Check
- (High_Bound (Index), Etype (Index_Typ));
+ (High_Bound (Index), Base_Type (Etype (Index_Typ)));
-- Otherwise the index denotes a single element