123
2012-06-15 21:31:01 UTC
In function Cache_client_enqueue variable ClientKey is incremented and
checked for negative values after that (in case of overflow).
Even though overflow is unlikely, signed integer overflow results in
wraparound on most systems and gcc don't seem to optimize away
overflow check even with -O3 (it only inlines Cache_client_enqueue in
my case) it is better to avoid overflow completely as there are other
compilers and compiler versions.
checked for negative values after that (in case of overflow).
Even though overflow is unlikely, signed integer overflow results in
wraparound on most systems and gcc don't seem to optimize away
overflow check even with -O3 (it only inlines Cache_client_enqueue in
my case) it is better to avoid overflow completely as there are other
compilers and compiler versions.