aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-03-25 16:49:18 +0100
committerTristan Gingold <tgingold@free.fr>2023-03-26 16:53:55 +0200
commitf846149c27804a2ce58bf6d2186e870a4d23791a (patch)
tree26bfd199cb5f7fab107a24203828c658441433d2 /src
parentc432c23196e6be7603ef9f1bafeca094104d35b9 (diff)
downloadghdl-f846149c27804a2ce58bf6d2186e870a4d23791a.tar.gz
ghdl-f846149c27804a2ce58bf6d2186e870a4d23791a.tar.bz2
ghdl-f846149c27804a2ce58bf6d2186e870a4d23791a.zip
sem_name_clean_1: also free names
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-sem_names.adb13
1 files changed, 9 insertions, 4 deletions
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);