diff --git a/sdc/ExceptionPath.cc b/sdc/ExceptionPath.cc index 78678649..d04946ff 100644 --- a/sdc/ExceptionPath.cc +++ b/sdc/ExceptionPath.cc @@ -1487,7 +1487,9 @@ ExceptionThru::deletePinEdges(const Pin *pin, } else { // erase prevents range iteration. - for (const EdgePins &edge_pins : *edges_) { + EdgePinsSet::Iterator edge_iter(edges_); + while (edge_iter.hasNext()) { + const EdgePins &edge_pins = edge_iter.next(); if (edge_pins.first == pin || edge_pins.second == pin) { edges_->erase(edge_pins); diff --git a/sdc/Sdc.cc b/sdc/Sdc.cc index 9cdbb63a..2cf82c33 100644 --- a/sdc/Sdc.cc +++ b/sdc/Sdc.cc @@ -5663,12 +5663,15 @@ Sdc::connectPinAfter(const Pin *pin) PinSet *drvrs = network_->drivers(pin); for (ExceptionPath *exception : exceptions_) { ExceptionPt *first_pt = exception->firstPt(); - for (ExceptionThru *thru : *exception->thrus()) { - if (thru->edges()) { - thru->connectPinAfter(drvrs, network_); - if (first_pt == thru) - recordExceptionEdges(exception, thru->edges(), - first_thru_edge_exceptions_); + ExceptionThruSeq *thrus = exception->thrus(); + if (thrus) { + for (ExceptionThru *thru : *exception->thrus()) { + if (thru->edges()) { + thru->connectPinAfter(drvrs, network_); + if (first_pt == thru) + recordExceptionEdges(exception, thru->edges(), + first_thru_edge_exceptions_); + } } } } @@ -5681,12 +5684,15 @@ Sdc::disconnectPinBefore(const Pin *pin) if (have_thru_hpin_exceptions_) { for (ExceptionPath *exception : exceptions_) { ExceptionPt *first_pt = exception->firstPt(); - for (ExceptionThru *thru : *exception->thrus()) { - if (thru->edges()) { - thru->disconnectPinBefore(pin, network_); - if (thru == first_pt) - recordExceptionEdges(exception, thru->edges(), - first_thru_edge_exceptions_); + ExceptionThruSeq *thrus = exception->thrus(); + if (thrus) { + for (ExceptionThru *thru : *exception->thrus()) { + if (thru->edges()) { + thru->disconnectPinBefore(pin, network_); + if (thru == first_pt) + recordExceptionEdges(exception, thru->edges(), + first_thru_edge_exceptions_); + } } } }