-
Notifications
You must be signed in to change notification settings - Fork 31
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
Running with UBSan throws runtime error regarding bitshift #52
Comments
DanielG
added a commit
to DanielG/theft
that referenced
this issue
Dec 18, 2019
Shifting a type by >=sizeof(type)*8 is undefined behaviour in C. Since t->prng.buf is overwritten on the next iteration anyways this thankfully isn't a real bug here. Fixes silentbicycle#52
DanielG
added a commit
to DanielG/theft
that referenced
this issue
Dec 18, 2019
Shifting a type by >=sizeof(type)*8 is undefined behaviour in C. Since t->prng.buf is overwritten on the next iteration anyways this thankfully isn't a real bug here. Fixes silentbicycle#52
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running theft with ubsan enabled (
-fsanitize=undefined
) I get the following error:At the mentioned source location we have:
According to the C standard shifting by more than the types size is undefined behaviour:
The text was updated successfully, but these errors were encountered: