mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 14:18:20 +00:00
Return compile error validation if Module is not valid wasm
This commit is contained in:
@@ -85,6 +85,10 @@ impl Module {
|
|||||||
// going to be used in development mode.
|
// going to be used in development mode.
|
||||||
return unsafe { Module::from_binary_unchecked(store, bytes.as_ref()) };
|
return unsafe { Module::from_binary_unchecked(store, bytes.as_ref()) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Err(CompileError::Validate(
|
||||||
|
"The module is not a valid WebAssembly file.".to_string(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file(store: &Store, file: impl AsRef<Path>) -> Result<Module, IoCompileError> {
|
pub fn from_file(store: &Store, file: impl AsRef<Path>) -> Result<Module, IoCompileError> {
|
||||||
|
|||||||
Reference in New Issue
Block a user