Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rt: fix queue regression #2362

Merged
merged 1 commit into from
Apr 2, 2020
Merged

rt: fix queue regression #2362

merged 1 commit into from
Apr 2, 2020

Conversation

carllerche
Copy link
Member

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

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
stuhood added a commit to twitter/pants that referenced this pull request Apr 2, 2020
# Delete this line to force CI to run the JVM tests.
[ci skip-jvm-tests]  # No JVM changes made.
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.

Panic in 0.2.14: attempt to add with overflow
2 participants