From 644dbe16d9c55def0fef1df1c333ff9bd8da52f2 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 21 May 2022 08:04:12 +0200 Subject: synth-vhdl_expr: avoid a memocy copy --- src/synth/synth-vhdl_expr.adb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 1f28e3fb2..cd6a25459 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -2218,10 +2218,14 @@ package body Synth.Vhdl_Expr is -- Propagate error. return No_Valtyp; end if; + if Base.Val.Kind = Value_Signal + and then Hook_Signal_Expr /= null + then + Base := Hook_Signal_Expr (Base); + end if; if Dyn.Voff = No_Net and then Is_Static (Base.Val) then - Res := Create_Value_Memory (Typ); - Copy_Memory - (Res.Val.Mem, Base.Val.Mem + Off.Mem_Off, Typ.Sz); + Res := Create_Value_Memtyp + ((Typ, Base.Val.Mem + Off.Mem_Off)); return Res; end if; return Synth_Read_Memory -- cgit v1.2.3