fixed arith overflow when computing ref count limit

This commit is contained in:
Jeff Hill
2002-11-25 23:28:12 +00:00
parent f73e968d77
commit b59f8a3759

View File

@@ -145,7 +145,7 @@ inline gddStatus gdd::reference(void) const
}
else ref_cnt++; // X aCC 818
if(ref_cnt>((1u<<(sizeof(ref_cnt)*CHAR_BIT))-2u))
if ( ref_cnt >= 0xffffffff )
{
fprintf(stderr,"gdd reference count overflow!!\n");
gddAutoPrint("gdd::reference()",gddErrorOverflow);