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

This commit is contained in:
Giles Atkinson 2022-11-24 17:30:25 +00:00 committed by Holger Vogt
parent b124749122
commit 48b51907fa
1 changed files with 5 additions and 3 deletions

View File

@ -430,10 +430,12 @@ int cm_analog_set_temp_bkpt(
}
/* 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);
}
/* If < current dynamic breakpoint, make it the current breakpoint */
if( time < g_mif_info.breakpoint.current)