aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-configuration.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-15 18:41:07 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-15 18:41:07 +0200
commitc9822a57bbce7c5a9a48829a0720d38abe20610b (patch)
treee387e8a07245d8e838b4a17a46d49dbcbd125325 /src/vhdl/vhdl-configuration.adb
parent86286af396045c10b2452276dc46013bc00f2cc3 (diff)
downloadghdl-c9822a57bbce7c5a9a48829a0720d38abe20610b.tar.gz
ghdl-c9822a57bbce7c5a9a48829a0720d38abe20610b.tar.bz2
ghdl-c9822a57bbce7c5a9a48829a0720d38abe20610b.zip
find_top_entity: avoid crash on missing entity, handle
Diffstat (limited to 'src/vhdl/vhdl-configuration.adb')
-rw-r--r--src/vhdl/vhdl-configuration.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb
index 25e29b305..8911c93dd 100644
--- a/src/vhdl/vhdl-configuration.adb
+++ b/src/vhdl/vhdl-configuration.adb
@@ -814,7 +814,10 @@ package body Vhdl.Configuration is
case Iir_Kinds_Entity_Aspect (Get_Kind (Aspect)) is
when Iir_Kind_Entity_Aspect_Entity =>
Unit := Get_Entity (Aspect);
- Set_Elab_Flag (Get_Parent (Unit), True);
+ if Unit /= Null_Node then
+ -- There may be an error (unit not found).
+ Set_Elab_Flag (Get_Parent (Unit), True);
+ end if;
when Iir_Kind_Entity_Aspect_Configuration
| Iir_Kind_Entity_Aspect_Open =>
null;