panic on native load failure (#11182)

This commit is contained in:
Jack May 2020-07-23 12:11:01 -07:00 committed by GitHub
parent b5a6a2f461
commit e75f0bdfd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -108,14 +108,12 @@ impl NativeLoader {
Ok(entrypoint) Ok(entrypoint)
} }
Err(e) => { Err(e) => {
warn!("Unable to find program entrypoint in {:?}: {:?})", name, e); panic!("Unable to find program entrypoint in {:?}: {:?})", name, e);
Err(NativeLoaderError::EntrypointNotFound.into())
} }
} }
} }
Err(e) => { Err(e) => {
warn!("Failed to load: {:?}", e); panic!("Failed to load: {:?}", e);
Err(NativeLoaderError::FailedToLoad.into())
} }
} }
} }
@ -135,8 +133,7 @@ impl NativeLoader {
let name = match str::from_utf8(name_vec) { let name = match str::from_utf8(name_vec) {
Ok(v) => v, Ok(v) => v,
Err(e) => { Err(e) => {
warn!("Invalid UTF-8 sequence: {}", e); panic!("Invalid UTF-8 sequence: {}", e);
return Err(NativeLoaderError::InvalidEntrypointName.into());
} }
}; };
trace!("Call native {:?}", name); trace!("Call native {:?}", name);