diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-12 14:25:12 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-12 14:25:12 +0200 |
commit | d62e341d5a3183d6fdb7168afb978068a396e9a4 (patch) | |
tree | 6371f1e406aa80c41fcec87270ed815b8eb35605 /common/design_utils.h | |
parent | 391d49c13ec675e263115d18481d4b842622b712 (diff) | |
parent | 9ee6a6e1149e35bcca3c1781f6ce84b11dc80296 (diff) | |
download | nextpnr-d62e341d5a3183d6fdb7168afb978068a396e9a4.tar.gz nextpnr-d62e341d5a3183d6fdb7168afb978068a396e9a4.tar.bz2 nextpnr-d62e341d5a3183d6fdb7168afb978068a396e9a4.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'common/design_utils.h')
-rw-r--r-- | common/design_utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/design_utils.h b/common/design_utils.h index b57c1cb6..2acc7d20 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -40,6 +40,8 @@ template <typename F1> CellInfo *net_only_drives(NetInfo *net, F1 cell_pred, IdString port, bool exclusive = false) { + if (net == nullptr) + return nullptr; if (exclusive && (net->users.size() != 1)) { return nullptr; } else { @@ -57,6 +59,8 @@ CellInfo *net_only_drives(NetInfo *net, F1 cell_pred, IdString port, template <typename F1> CellInfo *net_driven_by(NetInfo *net, F1 cell_pred, IdString port) { + if (net == nullptr) + return nullptr; if (cell_pred(net->driver.cell) && net->driver.port == port) { return net->driver.cell; } else { |