diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 13:58:26 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 13:58:26 -0700 |
commit | d90b8b081a6102303f2392fc21164fddde90e587 (patch) | |
tree | e1d693e8b953b162134d448dfa9c18b9e4dface9 /passes/pmgen/ice40_dsp.cc | |
parent | e3d898dccb3cf535a213f313693b2b7a4ede7c68 (diff) | |
download | yosys-d90b8b081a6102303f2392fc21164fddde90e587.tar.gz yosys-d90b8b081a6102303f2392fc21164fddde90e587.tar.bz2 yosys-d90b8b081a6102303f2392fc21164fddde90e587.zip |
Do not SigSpec::extract() beyond bounds
Diffstat (limited to 'passes/pmgen/ice40_dsp.cc')
-rw-r--r-- | passes/pmgen/ice40_dsp.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/passes/pmgen/ice40_dsp.cc b/passes/pmgen/ice40_dsp.cc index f6ae3a13f..5e87d6497 100644 --- a/passes/pmgen/ice40_dsp.cc +++ b/passes/pmgen/ice40_dsp.cc @@ -224,11 +224,11 @@ void create_ice40_dsp(ice40_dsp_pm &pm) pm.autoremove(st.ffH); pm.autoremove(st.addAB); if (st.ffO_lo) { - SigSpec O = st.sigO.extract(0,16); + SigSpec O = st.sigO.extract(0,GetSize(st.ffO_lo)); st.ffO_lo->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O))); } if (st.ffO_hi) { - SigSpec O = st.sigO.extract(16,16); + SigSpec O = st.sigO.extract(16,GetSize(st.ffo_hi)); st.ffO_hi->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O))); } } |