]> git.ipfire.org Git - people/ms/gcc.git/commit
[Ada] Fix internal error on declaration of derived discriminated record type
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 7 Jan 2022 23:48:58 +0000 (00:48 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:33 +0000 (09:27 +0000)
commit692a4bf88c5a4743bb5dca47b59a73a83add0fae
tree3bfbdb3694aedbd0611e0b435c7882f81e457533
parent5081e9205a6f12c41bdd5a7d630a732120fb4e92
[Ada] Fix internal error on declaration of derived discriminated record type

When the parent type has a variant part and the derived type is also
discriminated but statically selects a variant, the initialization
routine of the derived type may attempt to access components of other
variants that are no longer present.

gcc/ada/

* exp_ch4.adb (Handle_Changed_Representation): Simplify and fix
thinko in the loop building the constraints for discriminants.
* exp_ch5.adb (Make_Component_List_Assign): Try also to extract
discriminant values for a derived type.
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch5.adb