V0.9: 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.
This commit is contained in:
Cary R 2010-09-13 09:18:25 -07:00 committed by Stephen Williams
parent 0a94253261
commit cc024fde2b
1 changed files with 6 additions and 2 deletions

View File

@ -269,7 +269,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
@ -2725,7 +2725,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;