public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1629] [Ada] Missing check for assigning too-large array to fixed-lower-bound object
@ 2021-06-18 8:39 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-18 8:39 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:33a3b5f3a5034c3b41bd34fdf145da9a20743a28
commit r12-1629-g33a3b5f3a5034c3b41bd34fdf145da9a20743a28
Author: Gary Dismukes <dismukes@adacore.com>
Date: Fri Mar 19 19:28:38 2021 -0400
[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).
Diff:
---
gcc/ada/sem_ch3.adb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 346850de21a..9ef937df71e 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-18 8:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 8:39 [gcc r12-1629] [Ada] Missing check for assigning too-large array to fixed-lower-bound object Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).