From f846149c27804a2ce58bf6d2186e870a4d23791a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 25 Mar 2023 16:49:18 +0100 Subject: sem_name_clean_1: also free names --- src/vhdl/vhdl-sem_names.adb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index f6ab9f394..c7bbc407a 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -4616,10 +4616,15 @@ package body Vhdl.Sem_Names is -- Clear and free overload lists of Named_entity and type. Named_Entity := Get_Named_Entity (Name); Set_Named_Entity (Name, Null_Iir); - if Named_Entity /= Null_Iir - and then Is_Overload_List (Named_Entity) - then - Free_Iir (Named_Entity); + if Named_Entity /= Null_Iir then + case Get_Kind (Named_Entity) is + when Iir_Kind_Overload_List + | Iir_Kind_Selected_Element + | Iir_Kind_Indexed_Name => + Free_Iir (Named_Entity); + when others => + null; + end case; end if; Atype := Get_Type (Name); -- cgit v1.2.3