From e0f94103e7b528beb652ace2d602632afc76d812 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 15 Nov 2018 04:15:00 +0100 Subject: trans-chap3: fix a crash for array subtype of unbounded element. --- src/vhdl/translate/trans-chap3.adb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 7938a278d..3bb10630f 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -826,7 +826,9 @@ package body Trans.Chap3 is return; end if; - if Are_Bounds_Locally_Static (Def) then + if Get_Constraint_State (Def) = Fully_Constrained + and then Are_Bounds_Locally_Static (Def) + then if Global_Storage = O_Storage_External then -- Do not create the value of the type desc, since it -- is never dereferenced in a static type desc. @@ -1058,8 +1060,8 @@ package body Trans.Chap3 is Info.Type_Locally_Constrained := (Len >= 0); Info.B := Pinfo.B; Info.S := Pinfo.S; - if Is_Complex_Type (Get_Info (Get_Element_Subtype (Parent_Type))) - or else not Info.Type_Locally_Constrained + if not Info.Type_Locally_Constrained + or else not Is_Static_Type (Get_Info (Get_Element_Subtype (Def))) then -- This is a complex type as the size is not known at compile -- time. -- cgit v1.2.3