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