From b6a5511c44066ff38b9efee0e3eaff0aa4dda973 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 27 Jul 2022 05:28:41 +0200 Subject: elab-vhdl_expr: fix incorrect type of multi-dim array indexing during elab Fix #2143 --- src/synth/elab-vhdl_expr.adb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/synth/elab-vhdl_expr.adb b/src/synth/elab-vhdl_expr.adb index 3693f3249..4da248c64 100644 --- a/src/synth/elab-vhdl_expr.adb +++ b/src/synth/elab-vhdl_expr.adb @@ -754,6 +754,10 @@ package body Elab.Vhdl_Expr is Exec_Indexed_Name (Syn_Inst, Pfx, Dest_Typ, Off); Dest_Off := Dest_Off + Off; + + while not Dest_Typ.Alast loop + Dest_Typ := Get_Array_Element (Dest_Typ); + end loop; Dest_Typ := Get_Array_Element (Dest_Typ); end; @@ -791,6 +795,11 @@ package body Elab.Vhdl_Expr is Dest_Off.Mem_Off := Dest_Off.Mem_Off + Sl_Off.Mem_Off; end; + when Iir_Kind_Function_Call => + Dest_Base := Synth_Expression (Syn_Inst, Pfx); + Dest_Typ := Dest_Base.Typ; + Dest_Off := (0, 0); + when others => Error_Kind ("exec_assignment_prefix", Pfx); end case; -- cgit v1.2.3