aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-28 08:38:25 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-28 08:38:25 +0100
commit00ce55f9396cb7141beef0261ebaf11965326b01 (patch)
tree31049f786417b9ee77f0bbdccf5e2e9676d621b1 /src/synth
parent2efaa2396acf02fecc75341eb88353a325290e0b (diff)
downloadghdl-00ce55f9396cb7141beef0261ebaf11965326b01.tar.gz
ghdl-00ce55f9396cb7141beef0261ebaf11965326b01.tar.bz2
ghdl-00ce55f9396cb7141beef0261ebaf11965326b01.zip
synth: fix incorrect check in array subtype indications
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/elab-vhdl_types.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb
index 0f5472a36..e4963a11e 100644
--- a/src/synth/elab-vhdl_types.adb
+++ b/src/synth/elab-vhdl_types.adb
@@ -260,7 +260,7 @@ package body Elab.Vhdl_Types is
else
Typ := El_Typ;
for I in reverse 1 .. Ndims loop
- Idx := Get_Index_Type (Def, 0);
+ Idx := Get_Index_Type (Def, Flist_First + (I - 1));
Idx_Typ := Get_Subtype_Object (Syn_Inst, Idx);
Typ := Create_Unbounded_Array (Idx_Typ, I = Ndims, Typ);
end loop;
@@ -637,13 +637,19 @@ package body Elab.Vhdl_Types is
St_El : Node;
Res_Typ : Type_Acc;
Bnd : Bound_Type;
+ P : Type_Acc;
begin
Res_Typ := El_Typ;
for I in reverse Flist_First .. Flist_Last (St_Indexes) loop
St_El := Get_Index_Type (St_Indexes, I);
Bnd := Synth_Bounds_From_Range (Syn_Inst, St_El);
+ -- Get parent index.
+ P := Parent_Typ;
+ for J in Flist_First + 1 .. I loop
+ P := P.Uarr_El;
+ end loop;
Check_Bound_Compatibility
- (Syn_Inst, St_El, Bnd, Parent_Typ.Uarr_Idx);
+ (Syn_Inst, St_El, Bnd, P.Uarr_Idx);
if El_Bounded then
Res_Typ := Create_Array_Type
(Bnd, Res_Typ = El_Typ, Res_Typ);