From 6cd4a0dba88a6907d422d5a050608b5a38969060 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 12 Apr 2018 20:00:43 +0200 Subject: Avoid a crash on overload name used as a type mark. Fix #553 --- src/vhdl/sem_names.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index bdf1235b9..d8d7dea6e 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -889,8 +889,14 @@ package body Sem_Names is pragma Assert (Get_Type (Name) = Null_Iir); -- Analyze the name (if not already done). - if Get_Named_Entity (Name) = Null_Iir then + Res := Get_Named_Entity (Name); + if Res = Null_Iir then Sem_Name (Name); + Res := Get_Named_Entity (Name); + end if; + if Res /= Null_Iir and then Is_Overload_List (Res) then + Error_Msg_Sem (+Name, "name does not denote a type mark"); + return Create_Error_Type (Name); end if; Res := Finish_Sem_Name (Name); -- cgit v1.2.3