From 236f7eddef51acba2718eeda8431a1a68c7e231e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 22 Dec 2022 08:08:35 +0100 Subject: synth: handle element in target aggregate. Fix #2279 --- src/synth/synth-vhdl_stmts.adb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb index adab6e89a..58e04afad 100644 --- a/src/synth/synth-vhdl_stmts.adb +++ b/src/synth/synth-vhdl_stmts.adb @@ -331,9 +331,13 @@ package body Synth.Vhdl_Stmts is while Choice /= Null_Node loop pragma Assert (Get_Kind (Choice) = Iir_Kind_Choice_By_None); El := Get_Associated_Expr (Choice); - El_Typ := Elab.Vhdl_Expr.Exec_Name_Subtype (Syn_Inst, El); - Bnd := Get_Array_Bound (El_Typ); - Len := Len + Bnd.Len; + if Get_Element_Type_Flag (Choice) then + Len := Len + 1; + else + El_Typ := Elab.Vhdl_Expr.Exec_Name_Subtype (Syn_Inst, El); + Bnd := Get_Array_Bound (El_Typ); + Len := Len + Bnd.Len; + end if; Choice := Get_Chain (Choice); end loop; end; -- cgit v1.2.3