-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<barrier>
: Some _STL_VERIFY
s are not working well
#3748
Comments
Checking of Also, why don't we simply spell the value of Line 46 in c8d1efb
|
Yes, I wanted to have fewer comparisons here. Lines 123 to 124 in c8d1efb
I've elaborated this formula to avoid including |
For the constructor, as the check is performed on |
Hm, agree |
The following piece of code will not trigger any diagnosis.
A fixed check for the ctor would be
_STL_VERIFY(_Expected >= 0 and _Expected <= max(), ...);
. Also please considering adding a static_assert to guarantee thatmax() << _Barrier_value_shift
will keep positive and not lose any bit.STL/stl/inc/barrier
Lines 81 to 86 in c8d1efb
A fixed check for
arrive
would be_STL_VERIFY(_Update > 0 && _Update <= max(), ...)
, before shifting. (The second half of check is to avoid large positive values likePTRDIFF_MAX - 1
.)STL/stl/inc/barrier
Lines 95 to 98 in c8d1efb
The text was updated successfully, but these errors were encountered: