Fixed potential bug with -MINIMUM_VALUE
#1
Merged
EnilPajic
merged 3 commits from patch-1-negative-minimum-value
into master
4 years ago
Loading…
Reference in New Issue
There is no content yet.
Delete Branch 'patch-1-negative-minimum-value'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Original code had something like
N < 0 ? -N : N
which could fail ifN
has minimum value of appropriate type. For example, in original code this could fail:Also note that this code relies on "modulo on negative first operands" which was implementation defined in C++03 and before, but with C++11 and later it is defined by standard (see
ISO14882:2011(e)
), and this code anyway targets C++17 so we're safe here.d680c02d03
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.