Skip to content

Commit

Permalink
Fix: Hash @indices can grow larger than Int32::MAX bytes
Browse files Browse the repository at this point in the history
fixes #15341

Co-authored-by: Johannes Müller <straightshoota@gmail.com>
  • Loading branch information
ysbaddaden and straight-shoota committed Jan 15, 2025
1 parent 7135b1d commit 998ba8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hash.cr
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ class Hash(K, V)

# The actual number of bytes needed to allocate `@indices`.
private def indices_malloc_size(size)
size * @indices_bytesize
size.to_u64 * @indices_bytesize
end

# Reallocates `size` number of indices for `@indices`.
Expand Down

0 comments on commit 998ba8a

Please sign in to comment.