diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-05-13 12:57:23 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-05-17 07:19:48 +0200 |
commit | bd77edb0dd9886e8106003bd27579bfcbe6938ef (patch) | |
tree | 8145f8cdcecf71d1decbb09118d957a4eba70ff9 | |
parent | 0f0d483c355ca51bbc4f9d9bdb354d84a5fc4f76 (diff) | |
download | ghdl-bd77edb0dd9886e8106003bd27579bfcbe6938ef.tar.gz ghdl-bd77edb0dd9886e8106003bd27579bfcbe6938ef.tar.bz2 ghdl-bd77edb0dd9886e8106003bd27579bfcbe6938ef.zip |
Avoid cascaded crash for invalid mark_type name.
-rw-r--r-- | src/vhdl/sem_names.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index 674ffb4ec..7c58d4fe7 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -891,7 +891,11 @@ package body Sem_Names is Atype := Name_To_Type_Definition (Res); if Is_Error (Atype) then - Set_Named_Entity (Res, Atype); + if Get_Kind (Res) in Iir_Kinds_Denoting_Name then + Set_Named_Entity (Res, Atype); + else + return Create_Error_Type (Name); + end if; elsif not Incomplete then if Get_Kind (Atype) = Iir_Kind_Incomplete_Type_Definition then Error_Msg_Sem |