diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-09 05:33:54 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-09 05:33:54 +0200 |
commit | 33740eb403c9dfbe3fc1f75b50de3000535da6bc (patch) | |
tree | f3979416a9fb601badf64ef89c38bf05a19188d6 /src/synth/elab-vhdl_types.adb | |
parent | d54d4128c0c7a58deed223dea03c13ce548166a5 (diff) | |
download | ghdl-33740eb403c9dfbe3fc1f75b50de3000535da6bc.tar.gz ghdl-33740eb403c9dfbe3fc1f75b50de3000535da6bc.tar.bz2 ghdl-33740eb403c9dfbe3fc1f75b50de3000535da6bc.zip |
vhdl-annotations: avoid a crash with subtype attribute in array.
Fix #2084
Diffstat (limited to 'src/synth/elab-vhdl_types.adb')
-rw-r--r-- | src/synth/elab-vhdl_types.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb index ffddd20ae..b7f2da58f 100644 --- a/src/synth/elab-vhdl_types.adb +++ b/src/synth/elab-vhdl_types.adb @@ -220,6 +220,7 @@ package body Elab.Vhdl_Types is function Synth_Array_Type_Definition (Syn_Inst : Synth_Instance_Acc; Def : Node) return Type_Acc is + El_St : constant Node := Get_Element_Subtype_Indication (Def); El_Type : constant Node := Get_Element_Subtype (Def); Ndims : constant Natural := Get_Nbr_Dimensions (Def); Idx : Node; @@ -227,7 +228,9 @@ package body Elab.Vhdl_Types is Idx_Typ : Type_Acc; Typ : Type_Acc; begin - Synth_Subtype_Indication_If_Anonymous (Syn_Inst, El_Type); + if Get_Kind (El_St) in Iir_Kinds_Subtype_Definition then + Synth_Subtype_Indication (Syn_Inst, El_Type); + end if; El_Typ := Get_Subtype_Object (Syn_Inst, El_Type); if El_Typ.Kind in Type_Nets and then Ndims = 1 then |