diff --git a/src/builtins/BuiltinTypedArray.cpp b/src/builtins/BuiltinTypedArray.cpp index 5689f8914..670542de0 100644 --- a/src/builtins/BuiltinTypedArray.cpp +++ b/src/builtins/BuiltinTypedArray.cpp @@ -513,8 +513,8 @@ static Value fastTypedArrayIndexSearch(TypedArrayObject* arr, size_t k, size_t l uint8_t* buffer = arr->rawBuffer(); auto elementSize = arr->elementSize(); - int64_t byteK = static_cast(k * elementSize); - int64_t byteLength = static_cast(len * elementSize); + int64_t byteK = static_cast(k) * elementSize; + int64_t byteLength = static_cast(len) * elementSize; auto compFn = [](int64_t byteK, int64_t byteLength) -> bool { if (isForward) {