diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-05-24 19:12:02 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-05-24 19:12:02 +0200 |
commit | 626f7229e068914434c6d421dfc2ea7318e265c4 (patch) | |
tree | 9818e9bbd7c7138799c37ed1202af1fb6c48279f | |
parent | a0f3b72cd9eab143bcdb6f803ef35540dc4e667b (diff) | |
download | ghdl-626f7229e068914434c6d421dfc2ea7318e265c4.tar.gz ghdl-626f7229e068914434c6d421dfc2ea7318e265c4.tar.bz2 ghdl-626f7229e068914434c6d421dfc2ea7318e265c4.zip |
netlists-memories: avoid a crash on uninitialized ROM.
-rw-r--r-- | src/synth/netlists-memories.adb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index 85ce0e3fd..b19c4fda2 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -2330,7 +2330,15 @@ package body Netlists.Memories is return True; when Id_Signal | Id_Isignal => - return Is_Const_Input (Get_Input_Instance (Inst, 0)); + declare + Inp : constant Net := Get_Input_Net (Inst, 0); + begin + if Inp = No_Net then + return False; + else + return Is_Const_Input (Get_Net_Parent (Inp)); + end if; + end; when others => -- FIXME: handle other consts ? return False; |