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

Use bit size instead of byte size when parsing bitmasks. #21

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

jwagen
Copy link
Contributor

@jwagen jwagen commented Nov 29, 2020

It uses sizeof usize but that is in bytes. We need the size in bits. The bug
appeared when parsing the 32bit LOCK bit register. For smaller sizes the old
behaviour worked because sizeof::<usize> == 8 on most systems.

It uses sizeof usize but that is in bytes. We need the size in bits. The bug
appeared when parsing the 32bit LOCK bit register. For smaller sizes the old
behaviour worked because sizeof::<usize> == 8 on most systems.
@Rahix
Copy link
Owner

Rahix commented Nov 29, 2020

Huh, that does make sense to me at least!

Cc @octycs, you originally wrote this code. Any comments? I'd say this change looks correct, what do you think?

@Rahix Rahix merged commit fb23065 into Rahix:master Dec 3, 2020
@Rahix
Copy link
Owner

Rahix commented Dec 3, 2020

Thanks!

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