Skip to content

Commit 9b20e9a

Browse files
joshua-goldsteinbrain.duan
andauthored
fix(z): runtime error: index out of range for !amd64 env #287 (#307)
This PR cherry picks [PR 287](#287) into main. Co-authored-by: brain.duan <[email protected]>
1 parent dddaaf3 commit 9b20e9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

z/simd/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package simd
2020

2121
// Search uses the Clever search to find the correct key.
2222
func Search(xs []uint64, k uint64) int16 {
23-
if len(xs) < 8 {
23+
if len(xs) < 8 || (len(xs) % 8 != 0) {
2424
return Naive(xs, k)
2525
}
2626
var twos, pk [4]uint64

0 commit comments

Comments
 (0)