From 05a50dfc3123d4e7379885870febb8baeb52a446 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 10 Jul 2015 19:22:50 +0200 Subject: Avoid duplicate error message. --- src/vhdl/iirs_utils.ads | 2 +- src/vhdl/sem_specs.adb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/iirs_utils.ads b/src/vhdl/iirs_utils.ads index 96ac91dd4..cb4efe187 100644 --- a/src/vhdl/iirs_utils.ads +++ b/src/vhdl/iirs_utils.ads @@ -171,7 +171,7 @@ package Iirs_Utils is return Iir; -- Wrapper around Get_Entity_Name: return the entity declaration of the - -- entity name of DECL. + -- entity name of DECL, or Null_Iir in case of error. function Get_Entity (Decl : Iir) return Iir; -- Wrapper around get_Configuration_Name: return the configuration diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb index de48c4fe5..718ee1787 100644 --- a/src/vhdl/sem_specs.adb +++ b/src/vhdl/sem_specs.adb @@ -1039,6 +1039,9 @@ package body Sem_Specs is Entity_Name := Sem_Denoting_Name (Get_Entity_Name (Aspect)); Set_Entity_Name (Aspect, Entity_Name); Entity := Get_Named_Entity (Entity_Name); + if Entity = Error_Mark then + return Null_Iir; + end if; if Get_Kind (Entity) /= Iir_Kind_Entity_Declaration then Error_Class_Match (Entity_Name, "entity"); return Null_Iir; -- cgit v1.2.3