diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-20 07:38:37 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-20 07:38:37 +0200 |
commit | 18de5d6843c51457de5d85f5f8220de663f3bded (patch) | |
tree | a98a1b4fe87398893f2498fe0b4ffd461e137838 /src/synth | |
parent | bb3c706a8e91e3466983fc48e9473127c75f5970 (diff) | |
download | ghdl-18de5d6843c51457de5d85f5f8220de663f3bded.tar.gz ghdl-18de5d6843c51457de5d85f5f8220de663f3bded.tar.bz2 ghdl-18de5d6843c51457de5d85f5f8220de663f3bded.zip |
synth: avoid a crash while assigning null wires. Fix #1251
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-stmts.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index aaaa2ab25..b41a9ba69 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -446,11 +446,15 @@ package body Synth.Stmts is if Target.Obj.Val.Kind = Value_Wire then if Is_Static (V.Val) - and then V.Typ.W = Target.Obj.Typ.W + and then V.Typ.Sz = Target.Obj.Typ.Sz then pragma Assert (Target.Off = (0, 0)); Phi_Assign_Static (Target.Obj.Val.W, Get_Memtyp (V)); else + if V.Typ.W = 0 then + -- Forget about null wires. + return; + end if; Phi_Assign_Net (Get_Build (Syn_Inst), Target.Obj.Val.W, Get_Net (V), Target.Off.Net_Off); end if; |