diff options
author | Carl Lerche <me@carllerche.com> | 2020-04-02 07:52:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 07:52:02 -0700 |
commit | fa4fe9ef6feea7c8c88c81559797e57da7368b36 (patch) | |
tree | da38800980cbb49554f83c449535afa8952dacb4 /tokio/tests/sync_mpsc.rs | |
parent | f01136b5c0bbbe72fa674df4924cc53a872cffff (diff) |
rt: fix queue regression (#2362)
The new queue uses `u8` to track offsets. Cursors are expected to wrap.
An operation was performed with `+` instead of `wrapping_add`. This was
not _obviously_ issue before as it is difficult to wrap a `usize` on
64bit platforms, but wrapping a `u8` is trivial.
The fix is to use `wrapping_add` instead of `+`. A new test is added
that catches the issue.
Fixes #2361
Diffstat (limited to 'tokio/tests/sync_mpsc.rs')
0 files changed, 0 insertions, 0 deletions