diff --git a/ecmascript/ecma_vm.cpp b/ecmascript/ecma_vm.cpp index 8711177bf9..e0fb92db54 100644 --- a/ecmascript/ecma_vm.cpp +++ b/ecmascript/ecma_vm.cpp @@ -43,6 +43,7 @@ #include "ecmascript/stubs/runtime_stubs.h" #include "ecmascript/ohos/jit_tools.h" #include "ecmascript/ohos/aot_tools.h" +#include "ecmascript/checkpoint/thread_state_transition.h" #if defined(PANDA_TARGET_OHOS) && !defined(STANDALONE_MODE) #include "parameters.h" @@ -894,8 +895,9 @@ void EcmaVM::TriggerConcurrentCallback(JSTaggedValue result, JSTaggedValue hint) void *taskInfo = reinterpret_cast(thread_->GetTaskInfo()); // clear the taskInfo when return, which can prevent the callback to get it thread_->SetTaskInfo(reinterpret_cast(nullptr)); - concurrentCallback_(JSNApiHelper::ToLocal(JSHandle(thread_, result)), success, - taskInfo, concurrentData_); + auto localResultRef = JSNApiHelper::ToLocal(JSHandle(thread_, result)); + ThreadNativeScope nativeScope(thread_); + concurrentCallback_(localResultRef, success, taskInfo, concurrentData_); } void EcmaVM::DumpCallTimeInfo()