diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-15 04:15:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-15 04:15:00 +0100 |
commit | e0f94103e7b528beb652ace2d602632afc76d812 (patch) | |
tree | b4735006a130874f2dbeef315253e69178a44a27 /src/vhdl | |
parent | e4e670eb2e47caaf643f0aca91ba9a58d2a1e965 (diff) | |
download | ghdl-e0f94103e7b528beb652ace2d602632afc76d812.tar.gz ghdl-e0f94103e7b528beb652ace2d602632afc76d812.tar.bz2 ghdl-e0f94103e7b528beb652ace2d602632afc76d812.zip |
trans-chap3: fix a crash for array subtype of unbounded element.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 8 |
1 files changed, 5 insertions, 3 deletions
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. |