From 7fe05755eb49f2fd34ce0fe725978c7fadef8ee3 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 3 Jun 2020 00:17:21 +0200 Subject: [PATCH] [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. --- gcc/ada/exp_spark.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index 40621bd9e33..6454902f06b 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 -- 2.30.2