From f5a19fc488a0be8ef43a9952f8fa1337d66f8e6e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 1 Dec 2015 04:38:06 +0100 Subject: errorout: fix crash on entity_aspect_entity. --- src/vhdl/errorout.adb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/vhdl/errorout.adb') diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index 7982a9d..531dda4 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -496,8 +496,17 @@ package body Errorout is return "pathname element"; when Iir_Kind_Entity_Aspect_Entity => - return "aspect " & Disp_Node (Get_Entity (Node)) - & '(' & Image_Identifier (Get_Architecture (Node)) & ')'; + declare + Arch : constant Iir := Get_Architecture (Node); + Ent : constant Iir := Get_Entity (Node); + begin + if Arch = Null_Iir then + return "aspect " & Disp_Node (Ent); + else + return "aspect " & Disp_Node (Ent) + & '(' & Image_Identifier (Arch) & ')'; + end if; + end; when Iir_Kind_Entity_Aspect_Configuration => return "configuration entity aspect"; when Iir_Kind_Entity_Aspect_Open => -- cgit