diff --git a/src/algo/algo.go b/src/algo/algo.go index 2f0af3e4..7748a070 100644 --- a/src/algo/algo.go +++ b/src/algo/algo.go @@ -443,7 +443,7 @@ func FuzzyMatchV2(caseSensitive bool, normalize bool, forward bool, input *util. // we fall back to the greedy algorithm. // Also, we should not allow a very long pattern to avoid 16-bit integer // overflow in the score matrix. 1000 is a safe limit. - if slab != nil && N*M > cap(slab.I16) || M > 1000 { + if slab != nil && int64(N)*int64(M) > int64(cap(slab.I16)) || M > 1000 { return FuzzyMatchV1(caseSensitive, normalize, forward, input, pattern, withPos, slab) }