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

@ -2725,7 +2725,11 @@ DelayType NetCondit::delay_type() const
} else { } else {
/* Because of the indeterminate conditional value the /* Because of the indeterminate conditional value the
* best we can have for this case is a possible delay. */ * 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; return result;