diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-12-08 05:16:22 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-12-08 05:16:59 +0100 |
commit | ebba3c77dc798f2e20ad6ba8a560a569faf1526b (patch) | |
tree | c2aabd096cf8142cb9cf8d60a4992d94c1872125 /src/synth/synth-stmts.adb | |
parent | dbe4ff96ae2ee5aa3a41fbabc381f73ce96a217f (diff) | |
download | ghdl-ebba3c77dc798f2e20ad6ba8a560a569faf1526b.tar.gz ghdl-ebba3c77dc798f2e20ad6ba8a560a569faf1526b.tar.bz2 ghdl-ebba3c77dc798f2e20ad6ba8a560a569faf1526b.zip |
synth-stmts: avoid a crash on empty memories.
Diffstat (limited to 'src/synth/synth-stmts.adb')
-rw-r--r-- | src/synth/synth-stmts.adb | 5 |
1 files changed, 4 insertions, 1 deletions
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); |