From: Piotr Trojanek Date: Tue, 2 Jun 2020 22:17:21 +0000 (+0200) Subject: [Ada] Fix for possibly null ranges in 'Update and delta_aggregate X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fe05755eb49f2fd34ce0fe725978c7fadef8ee3;p=gcc.git [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. --- 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