diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-06-19 09:50:34 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-27 04:05:21 -0400 |
commit | 04c4a5101bb6c18933af3b3c3daf8053660cc1b6 (patch) | |
tree | b61278f84daf731cecccb5cd743a8e57c4188545 /gcc/ada/lib-xref.adb | |
parent | cb030dd7350381e47bdb168517507426ad23a297 (diff) | |
download | gcc-04c4a5101bb6c18933af3b3c3daf8053660cc1b6.zip gcc-04c4a5101bb6c18933af3b3c3daf8053660cc1b6.tar.gz gcc-04c4a5101bb6c18933af3b3c3daf8053660cc1b6.tar.bz2 |
[Ada] Assert failure on incorrect code
gcc/ada/
* lib-xref.adb (Generate_Reference): Protect against malformed
tree in case of severe errors.
* sem_ch8.adb (Add_Implicit_Operator): Ditto.
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r-- | gcc/ada/lib-xref.adb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index ac59ccc..ae4b4c7 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -595,7 +595,12 @@ package body Lib.Xref is -- Start of processing for Generate_Reference begin - pragma Assert (Nkind (E) in N_Entity); + -- May happen in case of severe errors + + if Nkind (E) not in N_Entity then + return; + end if; + Find_Actual (N, Formal, Call); if Present (Formal) then |