diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:38:28 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:38:28 +0200 |
commit | 718f9549bba57d358fc9e06d18f7ca6385266df6 (patch) | |
tree | 36e79523fd1c7609f0366aded048b2329df63b86 /src/vhdl/vhdl-sem_names.adb | |
parent | 6b56c016c59dc979e1d3c086387e0782917f0e06 (diff) | |
download | ghdl-718f9549bba57d358fc9e06d18f7ca6385266df6.tar.gz ghdl-718f9549bba57d358fc9e06d18f7ca6385266df6.tar.bz2 ghdl-718f9549bba57d358fc9e06d18f7ca6385266df6.zip |
vhdl: avoid crash on incorrect use of attributes.
For #2116
Diffstat (limited to 'src/vhdl/vhdl-sem_names.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_names.adb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |