diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-09-11 22:00:00 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2017-12-04 16:21:33 -0800 |
commit | 5d5c5ee9c5479677de30aa8faff7ccd51b944b91 (patch) | |
tree | 9db0b223cd41831533ec0d0c6b37313456b315b2 /README | |
parent | ea42e027d9abb3ba13cf8c63949a166797991daf (diff) |
Fix undefined-behavior with integer math
As reported to me:
"A calculation on signed integers has undefined behaviour if the result is not
representable in the type. In this case, it's trying to negate int_min, aka
-2^31 but the range of an int is [-2^31, 2^31-1] so it doesn't fit. Instead,
cast to unsigned which has 2's complement wrap-around arithmetic which is what
this particular function expects."
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions