diff options
author | Loic Prylli <lprylli@netflix.com> | 2019-04-10 14:25:35 -0700 |
---|---|---|
committer | Loic Prylli <lprylli@netflix.com> | 2019-04-27 01:56:08 +0000 |
commit | 95c46d8b7b03b1e0fce5169e78474cb2163ccde4 (patch) | |
tree | d4ed8ff76a116bb6a38e47ea0e2514656ae493d8 /unix | |
parent | 005db3528df041d1bbd69a07fa41ef7ea4404c19 (diff) | |
download | tigervnc-95c46d8b7b03b1e0fce5169e78474cb2163ccde4.tar.gz tigervnc-95c46d8b7b03b1e0fce5169e78474cb2163ccde4.zip |
Fix wrap-aware isAfter function in Congestion.cxx
Result of overflow on signed integer arithmetic is undefined in C/C++ standard.
So in previous version clang was compiling the statement as (int)a > (int)b (i.e. assuming no overflow), which leads to incorrect result.
Correct deterministic behavior means doing overflow arithmetic as unsigned, i.e.
a != b && a - b <= UINT_MAX / 2
Diffstat (limited to 'unix')
0 files changed, 0 insertions, 0 deletions