From 767a015dae0220c071084aa695db426d512a2447 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 30 Dec 2022 21:02:24 +0100 Subject: elab-vhdl_expr: fix a crash on simple aggregate --- src/synth/elab-vhdl_expr.adb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/synth/elab-vhdl_expr.adb b/src/synth/elab-vhdl_expr.adb index 86b2e5d24..34b3fe621 100644 --- a/src/synth/elab-vhdl_expr.adb +++ b/src/synth/elab-vhdl_expr.adb @@ -68,19 +68,13 @@ package body Elab.Vhdl_Expr is is Els : constant Iir_Flist := Get_Simple_Aggregate_List (Aggr); Last : constant Natural := Flist_Last (Els); - Aggr_Type : Node; + Aggr_Type : constant Node := Get_Type (Aggr); Res_Typ : Type_Acc; Val : Valtyp; Res : Valtyp; begin -- Allocate the result. - Aggr_Type := Get_Literal_Subtype (Aggr); - if Aggr_Type /= Null_Node then - Res_Typ := Synth_Subtype_Indication (Syn_Inst, Aggr_Type); - else - Aggr_Type := Get_Type (Aggr); - Res_Typ := Get_Subtype_Object (Syn_Inst, Aggr_Type); - end if; + Res_Typ := Synth_Subtype_Indication (Syn_Inst, Aggr_Type); pragma Assert (Get_Nbr_Dimensions (Aggr_Type) = 1); pragma Assert (Res_Typ.Abound.Len = Uns32 (Last + 1)); -- cgit v1.2.3