From 04c4a5101bb6c18933af3b3c3daf8053660cc1b6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 19 Jun 2020 09:50:34 -0400 Subject: [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. --- gcc/ada/lib-xref.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/ada/lib-xref.adb') 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 -- cgit v1.1