Skip to content

Conversation

AlexandreBlais42
Copy link
Contributor

Fixes #24208

Changed the variable d which was used to index a slice from a u64 to a usize.
The only possible values for d are 0 and 4, the behavior should be the same.

The test case provided in #24208 now compiles and gives the expected result.

$ zig build test
test
└─ run test stderr
sizeof usize is 8, hash is 6df7894534f98aba

$ zig build -Dtarget=riscv32-linux test
test
└─ run test stderr
sizeof usize is 4, hash is 6df7894534f98aba

@alexrp alexrp enabled auto-merge (rebase) July 19, 2025 12:25
@alexrp alexrp merged commit 4e6a049 into ziglang:master Jul 19, 2025
19 of 20 checks passed
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.

std.hash.RapidHash incorrectly assumes usize is 64 bits
2 participants