mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 21:58: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.
|
||||
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> {
|
||||
|
||||
Reference in New Issue
Block a user