NetCondit may have nil statements when calculating delay types.

It is possible for true clause, false clause, or both, to have
nil statements so the delay_type() method has to account for this.
This commit is contained in:
Stephen Williams 2010-10-02 10:38:59 -07:00
parent c4c7a619ea
commit 5f64a5ace4
1 changed files with 3 additions and 11 deletions

View File

@ -2690,17 +2690,9 @@ DelayType NetCase::delay_type() const
DelayType NetCondit::delay_type() const
{
DelayType result;
if (else_) {
result = combine_delays(if_->delay_type(), else_->delay_type());
} 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);
}
return result;
DelayType if_type = if_ ? if_->delay_type() : NO_DELAY;
DelayType el_type = else_? else_->delay_type() : NO_DELAY;
return combine_delays(if_type, el_type);
}
DelayType NetEvWait::delay_type() const