From ebba3c77dc798f2e20ad6ba8a560a569faf1526b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 8 Dec 2020 05:16:22 +0100 Subject: synth-stmts: avoid a crash on empty memories. --- src/synth/synth-stmts.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index 0e6bfc3dd..338f1421d 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -575,7 +575,10 @@ package body Synth.Stmts is if Dyn.Pfx_Off.Net_Off /= 0 then N := Build2_Extract (Ctxt, N, Dyn.Pfx_Off.Net_Off, Dyn.Pfx_Typ.W); end if; - N := Build_Dyn_Extract (Ctxt, N, Dyn.Voff, Off, Res_Typ.W); + if Res_Typ.W /= 0 then + -- Do not try to extract if the net is null. + N := Build_Dyn_Extract (Ctxt, N, Dyn.Voff, Off, Res_Typ.W); + end if; else pragma Assert (not Is_Static (Obj.Val)); N := Build2_Extract (Ctxt, N, Off, Res_Typ.W); -- cgit v1.2.3