From 2f9dd1c6ae96ae1c53f2ad88d3ea2a8cc298fa24 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Thu, 29 May 2014 13:42:22 +0200
Subject: Add_Dependence: noop if no current design.

---
 sem.adb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sem.adb b/sem.adb
index f90b29b95..042df9d2e 100644
--- a/sem.adb
+++ b/sem.adb
@@ -44,9 +44,17 @@ package body Sem is
    procedure Sem_Component_Configuration
      (Conf : Iir_Component_Configuration; Father : Iir);
 
-   procedure Add_Dependence (Unit : Iir) is
+   procedure Add_Dependence (Unit : Iir)
+   is
+      Targ : constant Iir := Get_Current_Design_Unit;
    begin
-      Add_Dependence (Get_Current_Design_Unit, Unit);
+      --  During normal analysis, there is a current design unit.  But not
+      --  during debugging outside of any context.
+      if Targ = Null_Iir then
+         return;
+      end if;
+
+      Add_Dependence (Targ, Unit);
    end Add_Dependence;
 
    --  LRM 1.1  Entity declaration.
-- 
cgit v1.2.3