Make too many imports an instantiation error (#1478)
* Make too many imports an instantiation error Previously we'd accidentally only take the head of the list when instantiating, but instead this changes the API to require exactly the right number of imports.
This commit is contained in:
@@ -124,6 +124,14 @@ impl Instance {
|
||||
}
|
||||
}
|
||||
|
||||
if imports.len() != module.imports().len() {
|
||||
bail!(
|
||||
"wrong number of imports provided, {} != {}",
|
||||
imports.len(),
|
||||
module.imports().len()
|
||||
);
|
||||
}
|
||||
|
||||
module.register_frame_info();
|
||||
let config = store.engine().config();
|
||||
let instance_handle = instantiate(
|
||||
|
||||
Reference in New Issue
Block a user