mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-30 13:40:51 +00:00
Throw JSERROR when load invalid input hsp path
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IA4N1O?from=project-issue Signed-off-by: chenjx-huawei <chenjingxiang1@huawei.com> Change-Id: I1c93dbaed6393e7f821885c1eabab31e094c2038
This commit is contained in:
parent
669297c4ca
commit
e8ca8bb697
@ -83,6 +83,10 @@ std::shared_ptr<JSPandaFile> JSPandaFileManager::LoadJSPandaFile(JSThread *threa
|
||||
std::string hspPath = ModulePathHelper::ParseHapPath(filename);
|
||||
if (hspPath.empty()) {
|
||||
LOG_FULL(ERROR) << ModuleMessageHelper::VmModuleInfoMessage(thread);
|
||||
if (!thread->IsMainThread()) {
|
||||
CString msg = "Invalid input hsp path: " + filename;
|
||||
THROW_TYPE_ERROR_AND_RETURN(thread, msg.c_str(), nullptr);
|
||||
}
|
||||
LOG_FULL(FATAL) << "Invalid input hsp path: " << filename;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ JSHandle<JSTaggedValue> SharedModuleManager::ResolveImportedModuleWithMerge(JSTh
|
||||
{
|
||||
std::shared_ptr<JSPandaFile> jsPandaFile = ModulePathHelper::SkipDefaultBundleFile(thread, fileName) ? nullptr :
|
||||
JSPandaFileManager::GetInstance()->LoadJSPandaFile(thread, fileName, recordName, false);
|
||||
RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread);
|
||||
if (jsPandaFile == nullptr) {
|
||||
// In Aot Module Instantiate, we miss some runtime parameters from framework like bundleName or moduleName
|
||||
// which may cause wrong recordName parsing and we also can't load files not in this app hap. But in static
|
||||
|
Loading…
Reference in New Issue
Block a user