From 898b6011360af7f006e777ef06868fde93a76622 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 2 May 2022 18:27:20 +0200 Subject: vhdl-sem_names(sem_selected_by_all_name): avoid a crash Emit an error message on invalid library declaration prefix. Fix #2048 --- src/vhdl/vhdl-sem_names.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index 0ce5943cd..ddf431438 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -3272,6 +3272,10 @@ package body Vhdl.Sem_Names is Spec => Prefix, Assoc_Chain => Null_Iir); Sem_As_Selected_By_All_Name (Prefix); + when Iir_Kind_Library_Declaration => + Error_Msg_Sem (+Name, "%n cannot be selected by all", +Prefix); + Set_Named_Entity (Name, Error_Mark); + return; when Iir_Kind_Error => Set_Named_Entity (Name, Error_Mark); return; -- cgit v1.2.3