diff options
author | Gary Dismukes <dismukes@adacore.com> | 2021-03-19 19:28:38 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-06-18 04:36:51 -0400 |
commit | 33a3b5f3a5034c3b41bd34fdf145da9a20743a28 (patch) | |
tree | 359ad3def0f68e8b63b4aa8001ec9185128c765c /gcc | |
parent | 9324e07dbd14cf1da1627676b5f4aeb6ba606e4a (diff) | |
download | gcc-33a3b5f3a5034c3b41bd34fdf145da9a20743a28.zip gcc-33a3b5f3a5034c3b41bd34fdf145da9a20743a28.tar.gz gcc-33a3b5f3a5034c3b41bd34fdf145da9a20743a28.tar.bz2 |
[Ada] Missing check for assigning too-large array to fixed-lower-bound object
gcc/ada/
* sem_ch3.adb (Constrain_Index): Set the High_Bound of a
fixed-lower-bound subtype's range to T (the subtype of the FLB
index being constrained) rather than Base_Type (T).
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 346850d..9ef937d 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -14397,7 +14397,7 @@ package body Sem_Ch3 is -- If this is a range for a fixed-lower-bound subtype, then set the -- index itype's lower bound to the FLB and the index type's upper bound - -- to the high bound of the index base type's high bound, mark the itype + -- to the high bound of the index subtype's high bound, mark the itype -- as an FLB index subtype, and set the range's Etype to the itype. if Nkind (S) = N_Range and then Is_FLB_Index then @@ -14405,7 +14405,7 @@ package body Sem_Ch3 is (Def_Id, Make_Range (Sloc (S), Low_Bound => Low_Bound (S), - High_Bound => Type_High_Bound (Base_Type (T)))); + High_Bound => Type_High_Bound (T))); Set_Is_Fixed_Lower_Bound_Index_Subtype (Def_Id); else |