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:
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user