From 5f1cfe42cf2aeea6250c4575daeff42cea4c02dc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 10 Oct 2022 18:21:01 +0200 Subject: synth: fix crashes on scalar attribute with anonymous subtype. --- src/synth/synth-vhdl_expr.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index c2d8f9eb8..33e5ab8ce 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -1538,7 +1538,7 @@ package body Synth.Vhdl_Expr is Val : Valtyp; Res : Valtyp; begin - Val := Synth_Expression (Syn_Inst, Param); + Val := Synth_Expression_With_Type (Syn_Inst, Param, Dtype); if Is_Static (Val.Val) then declare T : Int64; @@ -2314,8 +2314,8 @@ package body Synth.Vhdl_Expr is V : Valtyp; Dtype : Type_Acc; begin - V := Synth_Expression (Syn_Inst, Param); Dtype := Get_Subtype_Object (Syn_Inst, Get_Type (Expr)); + V := Synth_Expression_With_Type (Syn_Inst, Param, Dtype); -- FIXME: to be generalized. Not always as simple as a -- subtype conversion. if Is_Static (V.Val) then -- cgit v1.2.3