Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove uses of Option::unwrap_unchecked as a safety precaution #2310

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

marc0246
Copy link
Contributor

This adds a new function for converting a RangeBounds to a Range, as a replacement for where memory::range(..., ...).unwrap_unchecked() has been used before. Option::unwrap_unchecked is very dangerous, because when it goes south it can potentially end up deleting half your program from existence. Whereas with the manual unchecked implementation, the worst that can happen is arithmetic overflow and/or dereferencing an invalid pointer.

@Rua Rua merged commit 4ee8aa5 into vulkano-rs:master Aug 26, 2023
@marc0246 marc0246 deleted the range-unchecked branch August 26, 2023 20:58
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants