gcc/ada/
* sem_ch12.adb (Reset_Entity): Protect against malformed tree.
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));