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: overflow in qgrams for k=32 #478

Merged

Conversation

RagnarGrootKoerkamp
Copy link
Contributor

For k exactly equal to 32 (or generally when the assertion above has exact
equality), the 1<<(q*bits) overflows, which is undefined in rust. This PR
makes it defined behaviour.

@RagnarGrootKoerkamp RagnarGrootKoerkamp changed the title Fix undefined behaviour overflow for k=32 Fix overflow in qgrams for k=32 Feb 2, 2022
@dcroote dcroote changed the title Fix overflow in qgrams for k=32 fix: overflow in qgrams for k=32 Feb 2, 2022
@coveralls
Copy link

coveralls commented Feb 2, 2022

Coverage Status

Coverage increased (+0.09%) to 88.779% when pulling d31f971 on RagnarGrootKoerkamp:fix_shl_overflow into b244a21 on rust-bio:master.

@natir
Copy link
Contributor

natir commented Feb 2, 2022

Hello,

Nice find, I think it could be a good idea to add a small test to be sure this bug didn't come back in future.

@RagnarGrootKoerkamp
Copy link
Contributor Author

Good idea. done

@johanneskoester
Copy link
Contributor

We need to raise the MSRV to 1.53 for this. @RagnarGrootKoerkamp may I ask you to update the readme and also the MSRV job here?

@RagnarGrootKoerkamp
Copy link
Contributor Author

I could also use sizeof so the version doesn't need to be bumped. Or do you prefer to bump it anyway?

@RagnarGrootKoerkamp
Copy link
Contributor Author

Updated MSRV to 1.53

@johanneskoester johanneskoester merged commit 8048eb8 into rust-bio:master Feb 9, 2022
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.

None yet

4 participants