From 5f64a5ace4e90ba4da5363eedff8b373a2daf98d Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 2 Oct 2010 10:38:59 -0700 Subject: [PATCH] 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. --- netlist.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/netlist.cc b/netlist.cc index 215aedac8..264196863 100644 --- a/netlist.cc +++ b/netlist.cc @@ -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