diff --git a/kitty/simd-string-impl.h b/kitty/simd-string-impl.h index badacd12b..20084d014 100644 --- a/kitty/simd-string-impl.h +++ b/kitty/simd-string-impl.h @@ -289,12 +289,11 @@ FUNC(zero_last_n_bytes)(integer_t vec, const integer_t index, char n) { return andnot_si(mask, vec); } -#define check_chunk() { \ - if (n > -1) { \ - const uint8_t *ans = haystack + n; \ - zero_upper(); \ - return ans < limit ? ans : NULL; \ - }} +#define check_chunk() if (n > -1) { \ + const uint8_t *ans = haystack + n; \ + zero_upper(); \ + return ans < limit ? ans : NULL; \ +} #define find_match(haystack, sz, get_test_vec) { \ zero_upper(); \ diff --git a/kitty/simd-string.c b/kitty/simd-string.c index e7d03cc9e..7d258508c 100644 --- a/kitty/simd-string.c +++ b/kitty/simd-string.c @@ -118,6 +118,10 @@ test_find_either_of_two_bytes(PyObject *self UNUSED, PyObject *args) { func = find_either_of_two_bytes_128; break; case 3: func = find_either_of_two_bytes_256; break; + case 0: break; + default: + PyErr_SetString(PyExc_ValueError, "Unknown which_function"); + return NULL; } uint8_t *abuf; if (posix_memalign((void**)&abuf, 64, 256 + buf.len) != 0) { diff --git a/kitty_tests/parser.py b/kitty_tests/parser.py index b0473989a..51db5c7d7 100644 --- a/kitty_tests/parser.py +++ b/kitty_tests/parser.py @@ -293,11 +293,12 @@ class TestParser(BaseTest): def test(buf, a, b, align_offset=0): a, b = ord(a), ord(b) - sizes = [0] + sizes = [] if has_sse4_2: sizes.append(2) if has_avx2: sizes.append(3) + sizes.append(0) expected = test_find_either_of_two_bytes(buf, a, b, 1) for sz in sizes: