nf: Fix assert( pDp->F < FLT_MAX ); in nf

This error was triggered by what appears to be a missing
saturating float check in Nf_ManCutMatchOne. When opened
in the debugger AreaF starts at FLT_MAX and in some cases
can be added to itself which results in +Inf. I noticed the
other if had a  saturating condidtion.

I took a flyer on it, and added it to the previous condition,
and it resolved the error. I think this is a good fix.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
This commit is contained in:
Ethan Mahintorabi 2025-02-11 22:04:24 +00:00
parent d5e1a5d445
commit 2227d6d4e7
No known key found for this signature in database
GPG Key ID: 824E41B920BEA252
1 changed files with 4 additions and 1 deletions

View File

@ -1172,7 +1172,10 @@ void Nf_ManCutMatchOne( Nf_Man_t * p, int iObj, int * pCut, int * pCutSet )
if ( ArrivalA + pC->iDelays[k] <= Required && Required != SCL_INFINITY )
{
Delay = Abc_MaxInt( Delay, ArrivalA + pC->iDelays[k] );
AreaF += pBestF[iFanin]->M[fComplF][1].F;
if ( AreaF >= (float)1e32 || pBestF[iFanin]->M[fComplF][1].F >= (float)1e32 )
AreaF = (float)1e32;
else
AreaF += pBestF[iFanin]->M[fComplF][1].F;
}
else
{