From 18de5d6843c51457de5d85f5f8220de663f3bded Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 20 Apr 2020 07:38:37 +0200 Subject: synth: avoid a crash while assigning null wires. Fix #1251 --- src/synth/synth-stmts.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3