This commit is contained in:
Brian Carroll 2022-11-27 19:40:09 +00:00
parent c2fb626c17
commit 8ff843261a
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0

View file

@ -406,12 +406,14 @@ impl<'a> ExecutionState<'a> {
);
// Dereference the function pointer (look up the element index in the function table)
let fn_index = module.element.lookup(element_index).expect(&format!(
"Indirect function call failed. There is no function with element index {}",
element_index
)) as usize;
let fn_index = module.element.lookup(element_index).unwrap_or_else(|| {
panic!(
"Indirect function call failed. There is no function with element index {}",
element_index
)
});
self.do_call(Some(expected_signature), fn_index, module);
self.do_call(Some(expected_signature), fn_index as usize, module);
}
DROP => {
self.value_stack.pop();