Skip to content

std: non-byte-multiple sized integers have no definite representation - #7447

Merged
Vexu merged 3 commits into
ziglang:masterfrom
LemonBoy:fix-7445
Dec 23, 2020
Merged

Vexu merged 3 commits into
ziglang:masterfrom
LemonBoy:fix-7445

Conversation

@LemonBoy

Copy link
Copy Markdown
Contributor

Closes #7445

@LemonBoy

LemonBoy commented Dec 14, 2020 •

Copy link
Copy Markdown
Contributor Author

We can relax the definition of "definite representation" to bits % 8 == 0, I believe the true problem is mem.asBytes using @sizeOf instead of calculating the effective byte size from the bit one.

Edit: putting this on hold, gotta check a few things more.

@LemonBoy LemonBoy closed this Dec 14, 2020
@LemonBoy LemonBoy reopened this Dec 17, 2020
auto_hash must be extra careful when hashing integers whose bit size is
not a multiple of 8 as, when reinterpreted with mem.asBytes, may contain
undefined non-zero bits too.
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.

Inconsistent auto hashing of non-byte-multiple integers

2 participants