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

make ItemSliceSync::get_mut() check that the index is in range #1230

Closed
wants to merge 2 commits into from

Conversation

martinvonz
Copy link
Contributor

This removes some of the unsafety from
ItemSliceSync::get_mut(). There's still the unsafety that the caller needs to make sure a single index is not used concurrently.

This removes some of the unsafety from
ItemSliceSync::get_mut(). There's still the unsafety that the caller
needs to make sure a single index is not used concurrently.
By now we are certain the used indices are in bounds, but if they are
not this would not be detected by the test-suite first.
@Byron
Copy link
Member

Byron commented Jan 3, 2024

Thanks a lot!

Since this is an internal usage at some point the code has to 'trust itself' to indeed be correct. However, I have left the added check for use with debug assertions compiled in, so if there was a bug related to slice access now or in future it would be caught by this addition.

@Byron
Copy link
Member

Byron commented Jan 3, 2024

Sorry, I forgot to push my local merge earlier and now had to rebase to get it in. GH doesn't detect that, thus I have to close the PR.

@Byron Byron closed this Jan 3, 2024
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