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

Fix extractBits and insertBits When offset + count Overflows the Bit Width #5305

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

cwfitzgerald
Copy link
Member

Connections

Found in my push for #3159.

Description

All of the underlying implementations (including our polyfill) do not provide any guarantees about behavior when the offset/count overflows the bit width of the value being inserted/extracted. To counteract this, we first sanitize the offset/count to be within bounds before issuing the underlying call.

Testing

This is tested by a future PR submitting various integer tests for #3159.

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner February 26, 2024 08:25
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) February 29, 2024 20:36
@cwfitzgerald cwfitzgerald merged commit a5c0181 into gfx-rs:trunk Feb 29, 2024
27 checks passed
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