diff options
-rw-r--r-- | src/vhdl/iirs_utils.ads | 2 | ||||
-rw-r--r-- | src/vhdl/sem_specs.adb | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/vhdl/iirs_utils.ads b/src/vhdl/iirs_utils.ads index 96ac91d..cb4efe1 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 de48c4f..718ee17 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; |