Skip to content

Conversation

@dhh1128
Copy link

@dhh1128 dhh1128 commented Nov 27, 2014

...up_heap()

is called with index == 0. This error is currently harmless, since the next line
short-circuits when index == 0, but it seems prudent to remove the warning, both
to make Clang's sanitizer happy (remove false positive), and to make sure that
the function remains safe if subsequent logic changes.

Sample Clang output: /usr/include/asio/detail/timer_queue.hpp:195:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'

…en up_heap()

is called with index == 0. This error is currently harmless, since the next line
short-circuits when index == 0, but it seems prudent to remove the warning, both
to make Clang's sanitizer happy (remove false positive), and to make sure that
the function remains safe if subsequent logic changes.

Sample Clang output: /usr/include/asio/detail/timer_queue.hpp:195:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
@chriskohlhoff
Copy link
Owner

Fixed in c13d36c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants