From 19faeb8fece7ce9c798d057280df297350a54c4c Mon Sep 17 00:00:00 2001 From: hwx1163501 Date: Wed, 12 Jul 2023 10:36:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=804369?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hwx1163501 issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7KI26 --- ecmascript/js_array.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ecmascript/js_array.cpp b/ecmascript/js_array.cpp index c42cd300cd..60b2b31a55 100644 --- a/ecmascript/js_array.cpp +++ b/ecmascript/js_array.cpp @@ -439,14 +439,14 @@ bool JSArray::IncludeInSortedValue(JSThread *thread, const JSHandleIsJSArray()); JSHandle arrayObj = JSHandle::Cast(obj); - uint32_t length = arrayObj->GetArrayLength(); + int32_t length = static_cast(arrayObj->GetArrayLength()); if (length == 0) { return false; } - uint32_t left = 0; - uint32_t right = length - 1; + int32_t left = 0; + int32_t right = length - 1; while (left <= right) { - uint32_t middle = (left + right) / 2; + int32_t middle = (left + right) / 2; JSHandle vv = JSArray::FastGetPropertyByValue(thread, obj, middle); ComparisonResult res = JSTaggedValue::Compare(thread, vv, value); if (res == ComparisonResult::EQUAL) {