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:08:40 -07:00 committed by Stephen Williams
parent b252dc0192
commit 4001c7a27f
1 changed files with 6 additions and 2 deletions

View File

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