]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fix crash on declaration of overaligned array with constraints
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Jul 2022 22:01:15 +0000 (00:01 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 2 Sep 2022 07:34:06 +0000 (09:34 +0200)
commit7f64e37c1f6d5c0e7db588171cfff194cd78d490
tree67663e5141972509a292fd757676f95bfa3d4242
parent08a897d4ff7a482159148e2be9df83dae5a1055c
[Ada] Fix crash on declaration of overaligned array with constraints

The semantic analyzer was setting the Is_Constr_Subt_For_UN_Aliased flag on
the actual subtype of the object, which is incorrect because the nominal
subtype is constrained.  This also adjusts a recent related change.

gcc/ada/

* exp_util.adb (Expand_Subtype_From_Expr): Check for the presence
of the Is_Constr_Subt_For_U_Nominal flag instead of the absence
of the Is_Constr_Subt_For_UN_Aliased flag on the subtype of the
expression of an object declaration before reusing this subtype.
* sem_ch3.adb (Analyze_Object_Declaration): Do not incorrectly
set the Is_Constr_Subt_For_UN_Aliased flag on the actual subtype
of an array with definite nominal subtype.  Remove useless test.
gcc/ada/exp_util.adb
gcc/ada/sem_ch3.adb