fix inner concurrent function call fail

Signed-off-by: wangzhaoyong <wangzhaoyong@huawei.com>
Change-Id: If9196b61eb23357cbff3edcd5fc34fd83e49e340
This commit is contained in:
wangzhaoyong 2024-01-03 15:58:47 +08:00
parent edf5dc31ac
commit 553e1261af
2 changed files with 5 additions and 0 deletions

View File

@ -661,6 +661,10 @@ void EcmaVM::TriggerConcurrentCallback(JSTaggedValue result, JSTaggedValue hint)
return;
}
JSHandle<JSFunction> functionInfo(functionValue);
if (functionInfo->IsCallNapi()) {
LOG_ECMA(INFO) << "Function is not taskpool task";
return;
}
JSTaggedValue extraInfoValue = functionInfo->GetFunctionExtraInfo();
if (!extraInfoValue.IsJSNativePointer()) {
LOG_ECMA(INFO) << "FunctionExtraInfo is not JSNativePointer";

View File

@ -2569,6 +2569,7 @@ bool JSNApi::InitForConcurrentFunction(EcmaVM *vm, Local<JSValueRef> function, v
return false;
}
transFunc->SetFunctionExtraInfo(thread, nullptr, nullptr, taskInfo);
transFunc->SetCallNapi(false);
return true;
}