aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-12 15:34:21 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-12 15:34:21 +0100
commitabed55fed7722b0a22bffe59ef70c4d8e0b8a76a (patch)
treefaabac17ce6e175b183ca909c60e042375f3d9f9 /src
parent7d7b759c56476f4fee5f42b9086a292ac3956f55 (diff)
downloadghdl-abed55fed7722b0a22bffe59ef70c4d8e0b8a76a.tar.gz
ghdl-abed55fed7722b0a22bffe59ef70c4d8e0b8a76a.tar.bz2
ghdl-abed55fed7722b0a22bffe59ef70c4d8e0b8a76a.zip
synth-decls: always initialize variables. Fix #1081
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-decls.adb9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index f59253ea1..5644d220f 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -608,19 +608,14 @@ package body Synth.Decls is
Init := Synth_Subtype_Conversion
(Init, Obj_Type, False, Decl);
else
- if Get_Instance_Const (Syn_Inst) then
- Init := Create_Value_Default (Obj_Type);
- else
- Init := null;
- end if;
+ Init := Create_Value_Default (Obj_Type);
end if;
if Get_Instance_Const (Syn_Inst) then
- pragma Assert (Init /= null);
Create_Object (Syn_Inst, Decl, Unshare (Init, Current_Pool));
else
Create_Wire_Object (Syn_Inst, Wire_Variable, Decl);
Create_Var_Wire (Syn_Inst, Decl, Init);
- if Is_Subprg and then Init /= null then
+ if Is_Subprg then
Phi_Assign
(Get_Build (Syn_Inst),
Get_Value (Syn_Inst, Decl).W, Get_Net (Init), 0);