Fix bug worker Fallback

issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I60P7R?from=project-issue

Signed-off-by: changjiaxing <changjiaxing2@huawei.com>
Change-Id: I7f47bfc59894d43827437a8e401de001ca593797
This commit is contained in:
changjiaxing 2022-11-11 15:18:15 +08:00
parent 092cebea91
commit 216811153c

View File

@ -68,6 +68,9 @@ const JSPandaFile *JSPandaFileManager::LoadJSPandaFile(JSThread *thread, const C
const JSPandaFile *JSPandaFileManager::LoadJSPandaFile(JSThread *thread, const CString &filename,
std::string_view entryPoint, const void *buffer, size_t size)
{
if (buffer == nullptr || size == 0) {
return nullptr;
}
{
os::memory::LockHolder lock(jsPandaFileLock_);
const JSPandaFile *jsPandaFile = FindJSPandaFileUnlocked(filename);
@ -77,10 +80,6 @@ const JSPandaFile *JSPandaFileManager::LoadJSPandaFile(JSThread *thread, const C
}
}
if (buffer == nullptr || size == 0) {
return nullptr;
}
auto pf = panda_file::OpenPandaFileFromMemory(buffer, size);
if (pf == nullptr) {
LOG_ECMA(ERROR) << "open file " << filename << " error";