Browse Source

Prevent crash when cm_analog_set_temp_bkpt() is called during OPtran().

pre-master-46
Giles Atkinson 3 years ago
committed by Holger Vogt
parent
commit
7ead974a5a
  1. 8
      src/xspice/cm/cm.c

8
src/xspice/cm/cm.c

@ -430,10 +430,12 @@ int cm_analog_set_temp_bkpt(
} }
/* If too close to a permanent breakpoint or the current time, discard it */ /* If too close to a permanent breakpoint or the current time, discard it */
if( (fabs(time - ckt->CKTbreaks[0]) < ckt->CKTminBreak) ||
(fabs(time - ckt->CKTbreaks[1]) < ckt->CKTminBreak) ||
(fabs(time - ckt->CKTtime) < ckt->CKTminBreak) )
if ((ckt->CKTbreaks &&
(fabs(time - ckt->CKTbreaks[0]) < ckt->CKTminBreak ||
fabs(time - ckt->CKTbreaks[1]) < ckt->CKTminBreak)) ||
fabs(time - ckt->CKTtime) < ckt->CKTminBreak) {
return(MIF_OK); return(MIF_OK);
}
/* If < current dynamic breakpoint, make it the current breakpoint */ /* If < current dynamic breakpoint, make it the current breakpoint */
if( time < g_mif_info.breakpoint.current) if( time < g_mif_info.breakpoint.current)

Loading…
Cancel
Save