-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
_Least_max_valueis required to be non-negative. There are already a lot of runtime checks forstd::counting_semaphore's methods. For better coding experience, please consider addingstatic_assert(_Least_max_value >= 0, ...)for the class._Waitispublicbut is only used by other members. Please consider declaring it asprivate.- This check is conceptually unsafe as
_Prev + _Updatecan possibly lead to signed integer overflow. Please consider replacing it with_Update <= _Least_max_value - _Prev. (Additionally,_Prev + _Update > 0is implicitly guaranteed by previous checks and may be omitted here.)
Line 94 in c8d1efb
_STL_VERIFY(_Prev + _Update > 0 && _Prev + _Update <= _Least_max_value,
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!