diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-22 22:12:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 22:12:41 -0700 |
commit | b700592881a2f2a87cca9776cd9bfca85781c9ec (patch) | |
tree | 559ae8593ad3a6ab35b756c68606f44bcb046a2c /kernel/rtlil.cc | |
parent | fa9df06c9dc5ead43645ba973e2ca8c63adfb29d (diff) | |
parent | 51ae0f4e20815df98204b72bd740c00f5f2a1197 (diff) | |
download | yosys-b700592881a2f2a87cca9776cd9bfca85781c9ec.tar.gz yosys-b700592881a2f2a87cca9776cd9bfca85781c9ec.tar.bz2 yosys-b700592881a2f2a87cca9776cd9bfca85781c9ec.zip |
Merge pull request #1984 from YosysHQ/eddie/getParam_exception
kernel: Cell::getParam() to throw exception again if not found
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 2aefe30b1..196e301b6 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -2619,16 +2619,15 @@ void RTLIL::Cell::setParam(RTLIL::IdString paramname, RTLIL::Const value) const RTLIL::Const &RTLIL::Cell::getParam(RTLIL::IdString paramname) const { - static const RTLIL::Const empty; const auto &it = parameters.find(paramname); if (it != parameters.end()) return it->second; if (module && module->design) { RTLIL::Module *m = module->design->module(type); if (m) - return m->parameter_default_values.at(paramname, empty); + return m->parameter_default_values.at(paramname); } - return empty; + throw std::out_of_range("Cell::getParam()"); } void RTLIL::Cell::sort() |