fix crash when trying to load and ffi library with an invalid type specification
This commit is contained in:
committed by
Bennet Bleßmann
parent
db3f2717bc
commit
34eab2e73a
@@ -5148,7 +5148,11 @@ impl Machine {
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
self.foreign_function_table
|
||||
.define_struct(&struct_name.as_str(), fields);
|
||||
.define_struct(&struct_name.as_str(), fields)
|
||||
.map_err(|err| {
|
||||
let ffi_error = self.machine_st.ffi_error(err);
|
||||
self.machine_st.error_form(ffi_error, stub_gen())
|
||||
})?;
|
||||
return Ok(());
|
||||
}
|
||||
self.machine_st.fail = true;
|
||||
|
||||
Reference in New Issue
Block a user