From bd7084d4fc1a8c990ce82286b3f4850949b01a29 Mon Sep 17 00:00:00 2001 From: 18157154025 Date: Tue, 25 Mar 2025 21:48:11 +0800 Subject: [PATCH] Fixed SendableArray bug Fixed SendableArray bug Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IBW9DU?from=project-issue Signed-off-by: 18157154025 Change-Id: Ie1a4f35293fc65f7b59f8ad5162619ef3b1868ad --- ecmascript/napi/jsnapi_expo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ecmascript/napi/jsnapi_expo.cpp b/ecmascript/napi/jsnapi_expo.cpp index 2c0d41f856..72fc943f3b 100644 --- a/ecmascript/napi/jsnapi_expo.cpp +++ b/ecmascript/napi/jsnapi_expo.cpp @@ -18,6 +18,7 @@ #include "ecmascript/base/json_stringifier.h" #include "ecmascript/base/typed_array_helper-inl.h" #include "ecmascript/builtins/builtins_object.h" +#include "ecmascript/shared_objects/concurrent_api_scope.h" #if defined(ECMASCRIPT_SUPPORT_CPUPROFILER) #include "ecmascript/dfx/cpu_profiler/cpu_profiler.h" #endif @@ -3938,6 +3939,8 @@ Local SendableArrayRef::GetValueAt(const EcmaVM *vm, Local object = JSNApiHelper::ToJSHandle(obj); + // Add Concurrent check for shared array + [[maybe_unused]] ecmascript::ConcurrentApiScope scope(thread, object); JSHandle result = ecmascript::JSSharedArray::FastGetPropertyByValue(thread, object, index); return JSNApiHelper::ToLocal(result); } -- Gitee