diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp index 1e194af701f..a31474a60a7 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp +++ b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp @@ -99,7 +99,7 @@ int polyHash_arm(int length, uint16_t const* str) { // Vectorization is not supported. return polyHash_naive(length, str); } - int res; + uint32_t res; if (length < 488) res = NeonTraits::polyHashUnalignedUnrollUpTo16(length / 4, str); else diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/naive.h b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h index 20ca0a85052..762763c0dbd 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/naive.h +++ b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h @@ -9,7 +9,7 @@ #include inline int polyHash_naive(int length, uint16_t const* str) { - int res = 0; + uint32_t res = 0; for (int i = 0; i < length; ++i) res = res * 31 + str[i]; return res; diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp index a5b2b321637..406a33fccb9 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp +++ b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp @@ -143,7 +143,7 @@ int polyHash_x86(int length, uint16_t const* str) { // Either vectorization is not supported or the string is too short to gain from it. return polyHash_naive(length, str); } - int res; + uint32_t res; if (length < 32) res = SSETraits::polyHashUnalignedUnrollUpTo8(length / 4, str); else if (!avx2Supported)