Skip to content

Commit

Permalink
fix(z): runtime error: index out of range for !amd64 env #287
Browse files Browse the repository at this point in the history
fix `runtime error: index out of range`  in non-amd64 (arm64) env

(cherry picked from commit efb105d)
  • Loading branch information
brain.duan authored and joshua-goldstein committed Sep 15, 2022
1 parent 1ff978f commit 4fcbae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion z/simd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package simd

// Search uses the Clever search to find the correct key.
func Search(xs []uint64, k uint64) int16 {
if len(xs) < 8 {
if len(xs) < 8 || (len(xs) % 8 != 0) {
return Naive(xs, k)
}
var twos, pk [4]uint64
Expand Down

0 comments on commit 4fcbae6

Please sign in to comment.