From bd77edb0dd9886e8106003bd27579bfcbe6938ef Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 13 May 2017 12:57:23 +0200 Subject: Avoid cascaded crash for invalid mark_type name. --- src/vhdl/sem_names.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3