aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-04-12 20:00:43 +0200
committerTristan Gingold <tgingold@free.fr>2018-04-12 20:00:43 +0200
commit6cd4a0dba88a6907d422d5a050608b5a38969060 (patch)
tree5762cc2dc8ce7a5f5503bda9598347f8a5a76629 /src
parent60f3bb31069e3c7aeff03945a7cde7c4506bf37e (diff)
downloadghdl-6cd4a0dba88a6907d422d5a050608b5a38969060.tar.gz
ghdl-6cd4a0dba88a6907d422d5a050608b5a38969060.tar.bz2
ghdl-6cd4a0dba88a6907d422d5a050608b5a38969060.zip
Avoid a crash on overload name used as a type mark.
Fix #553
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/sem_names.adb8
1 files changed, 7 insertions, 1 deletions
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);