From 718f9549bba57d358fc9e06d18f7ca6385266df6 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 2 Jul 2022 07:38:28 +0200 Subject: vhdl: avoid crash on incorrect use of attributes. For #2116 --- src/vhdl/vhdl-sem_names.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/vhdl/vhdl-sem_names.adb') diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index c9420ba4b..043ca36e8 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -962,7 +962,7 @@ package body Vhdl.Sem_Names is if Get_Kind (Res) in Iir_Kinds_Denoting_Name then Set_Named_Entity (Res, Atype); else - return Create_Error_Type (Name); + Res := Create_Error_Type (Name); end if; elsif not Incomplete then if Get_Kind (Atype) = Iir_Kind_Incomplete_Type_Definition then @@ -5017,7 +5017,8 @@ package body Vhdl.Sem_Names is Atype : Iir; begin case Get_Kind (Name) is - when Iir_Kinds_Denoting_Name => + when Iir_Kinds_Denoting_Name + | Iir_Kind_Attribute_Name => -- Common correct case. Atype := Get_Named_Entity (Name); case Get_Kind (Atype) is -- cgit v1.2.3