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

parent_many: force a constant to u64 #51

Merged
merged 1 commit into from
Jun 26, 2024

Commits on Jun 26, 2024

  1. parent_many: force a constant to u64

    By default, in 64 bits machine rustc will interpret constants as u32,
    but in parent_many we left shift a constant by the depth of the forest, which can
    be grather than 32. This would a 32-bits value to be left-shifted by
    more than 32. This is undefined behavour and should be avoided.
    
    This commit coerces the constants to u64, making it safe shift up to 63.
    Since tree with depth 63 would be impossible to see in practice (it
    would represent quadrilions of leaves), there's no risk of having the
    same UB now.
    Davidson-Souza committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    6b09c7d View commit details
    Browse the repository at this point in the history