aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-12-30 21:02:24 +0100
committerTristan Gingold <tgingold@free.fr>2022-12-31 13:54:49 +0100
commit767a015dae0220c071084aa695db426d512a2447 (patch)
tree4c0895483e90297ed37ba32d1286c3340356268f /src/synth/elab-vhdl_expr.adb
parent9801a910f41ce2cfe95ff12b220799350a0097e7 (diff)
downloadghdl-767a015dae0220c071084aa695db426d512a2447.tar.gz
ghdl-767a015dae0220c071084aa695db426d512a2447.tar.bz2
ghdl-767a015dae0220c071084aa695db426d512a2447.zip
elab-vhdl_expr: fix a crash on simple aggregate
Diffstat (limited to 'src/synth/elab-vhdl_expr.adb')
-rw-r--r--src/synth/elab-vhdl_expr.adb10
1 files 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));