From 265881a175f2e9a9f222b0d06780811c6ab6cd93 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 5 Feb 2022 17:04:58 +0100 Subject: synth-vhdl_aggr: fix mismatch. Fix #1962 --- src/synth/synth-vhdl_aggr.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/synth') diff --git a/src/synth/synth-vhdl_aggr.adb b/src/synth/synth-vhdl_aggr.adb index 6ba9fda0d..6e7d3447f 100644 --- a/src/synth/synth-vhdl_aggr.adb +++ b/src/synth/synth-vhdl_aggr.adb @@ -486,7 +486,10 @@ package body Synth.Vhdl_Aggr is begin Els_Typ := Create_Rec_El_Array (Aggr_Type.Rec.Len); for I in Els_Typ.E'Range loop - Els_Typ.E (I).Typ := Tab_Res (Nat32 (I)).Typ; + -- Note: elements are put in reverse order in Tab_Res, + -- so reverse again... + Els_Typ.E (I).Typ := + Tab_Res (Tab_Res'Last - Nat32 (I) + 1).Typ; end loop; Res_Typ := Create_Record_Type (Els_Typ); end; @@ -497,6 +500,8 @@ package body Synth.Vhdl_Aggr is if Const_P then Res := Create_Value_Memory (Res_Typ); for I in Aggr_Type.Rec.E'Range loop + -- Note: elements are put in reverse order in Tab_Res, + -- so reverse again... Write_Value (Res.Val.Mem + Res_Typ.Rec.E (I).Moff, Tab_Res (Tab_Res'Last - Nat32 (I) + 1)); end loop; -- cgit v1.2.3