summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorLoic Prylli <lprylli@netflix.com>2019-04-10 14:25:35 -0700
committerLoic Prylli <lprylli@netflix.com>2019-04-27 01:56:08 +0000
commit95c46d8b7b03b1e0fce5169e78474cb2163ccde4 (patch)
treed4ed8ff76a116bb6a38e47ea0e2514656ae493d8 /unix
parent005db3528df041d1bbd69a07fa41ef7ea4404c19 (diff)
downloadtigervnc-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