diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-01-11 07:43:03 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-01-11 07:43:03 +0100 |
commit | c2f7e242b048ae2691681d62b099ecf9634d6407 (patch) | |
tree | e5167810533a59dae77d845065e2aefa20136d15 /src/synth | |
parent | 39e7b128b765278f6b0197d5804afc8f43fb179f (diff) | |
download | ghdl-c2f7e242b048ae2691681d62b099ecf9634d6407.tar.gz ghdl-c2f7e242b048ae2691681d62b099ecf9634d6407.tar.bz2 ghdl-c2f7e242b048ae2691681d62b099ecf9634d6407.zip |
synth-cleanup: avoid a crash on undriven output. Fix #1078
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/netlists-cleanup.adb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/synth/netlists-cleanup.adb b/src/synth/netlists-cleanup.adb index 4d2cc40a9..f7342add9 100644 --- a/src/synth/netlists-cleanup.adb +++ b/src/synth/netlists-cleanup.adb @@ -129,9 +129,11 @@ package body Netlists.Cleanup is if Get_Id (Inst) = Id_Output then Inp := Get_Input (Inst, 0); O := Get_Driver (Inp); - Disconnect (Inp); - - Redirect_Inputs (Get_Output (Inst, 0), O); + if O /= No_Net then + -- Only when the output is driven. + Disconnect (Inp); + Redirect_Inputs (Get_Output (Inst, 0), O); + end if; Remove_Instance (Inst); end if; |