2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-24 15:11:23 +08:00

[Ada] Assert failure on incorrect code

gcc/ada/

	* sem_ch12.adb (Reset_Entity): Protect against malformed tree.
This commit is contained in:
Arnaud Charlet 2020-06-23 03:56:34 -04:00 committed by Pierre-Marie de Rodat
parent 96ece83775
commit cc53bec460

@ -15701,7 +15701,12 @@ package body Sem_Ch12 is
elsif Nkind (Parent (N)) = N_Selected_Component
and then Nkind (Parent (N2)) = N_Expanded_Name
then
if Is_Global (Entity (Parent (N2))) then
-- In case of previous errors, the tree might be malformed
if No (Entity (Parent (N2))) then
null;
elsif Is_Global (Entity (Parent (N2))) then
Change_Selected_Component_To_Expanded_Name (Parent (N));
Set_Associated_Node (Parent (N), Parent (N2));
Set_Global_Type (Parent (N), Parent (N2));