From 4001c7a27f5862952f59d06c7fd21b37138d95cd Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 13 Sep 2010 09:08:40 -0700 Subject: [PATCH] An if statement is optional and results in no delay. While checking for an infinite loop in an always block I missed the case where an if statement does not have a statement. This was resulting in a segmentation fault. --- netlist.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/netlist.cc b/netlist.cc index 215aedac8..bce287665 100644 --- a/netlist.cc +++ b/netlist.cc @@ -227,7 +227,7 @@ bool NetPins::is_linked(void) NetObj::NetObj(NetScope*s, perm_string n, unsigned np) : NetPins(np), scope_(s), name_(n), delay1_(0), delay2_(0), delay3_(0) { - /* Don't + /* Don't ivl_assert(*this, np > 0); * because it would happen before we get to print a useful * message in the NetNet constructor @@ -2697,7 +2697,11 @@ DelayType NetCondit::delay_type() const } else { /* Because of the indeterminate conditional value the * best we can have for this case is a possible delay. */ - result = combine_delays(if_->delay_type(), NO_DELAY); + if (if_) { + result = combine_delays(if_->delay_type(), NO_DELAY); + } else { + result = NO_DELAY; + } } return result;