aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/design_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/design_utils.h b/common/design_utils.h
index 43ff180b..9d027d58 100644
--- a/common/design_utils.h
+++ b/common/design_utils.h
@@ -37,6 +37,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 {
@@ -54,6 +56,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 {