Minor corrections with latest changes.

This commit is contained in:
Peter Huene
2021-04-16 11:06:24 -07:00
parent 726a936474
commit 6ac1321162
5 changed files with 5 additions and 5 deletions

View File

@@ -750,7 +750,7 @@ impl VMExternRefActivationsTable {
///
/// It is the responsibility of the caller to not have the pointer outlive
/// the stack map lookup trait object.
pub unsafe trait StackMapLookup {
pub unsafe trait StackMapLookup: 'static {
/// Lookup the stack map at a program counter (PC) value.
fn lookup(&self, pc: usize) -> Option<*const StackMap>;
}

View File

@@ -207,7 +207,7 @@ unsafe impl WasmTy for Option<ExternRef> {
unsafe {
store
.externref_activations_table()
.insert_with_gc(x.inner, &*store.stack_map_lookup());
.insert_with_gc(x.inner, store.stack_map_lookup());
}
abi
} else {

View File

@@ -524,7 +524,7 @@ impl<'a> Instantiator<'a> {
externref_activations_table: self.store.externref_activations_table()
as *const VMExternRefActivationsTable
as *mut _,
stack_map_lookup: Some(std::mem::transmute(self.store.stack_map_lookup())),
stack_map_lookup: Some(self.store.stack_map_lookup()),
})?;
// After we've created the `InstanceHandle` we still need to run

View File

@@ -77,7 +77,7 @@ fn create_handle(
externref_activations_table: store.externref_activations_table()
as *const VMExternRefActivationsTable
as *mut _,
stack_map_lookup: Some(std::mem::transmute(store.stack_map_lookup())),
stack_map_lookup: Some(store.stack_map_lookup()),
},
)?;

View File

@@ -98,7 +98,7 @@ impl Val {
let externref_ptr = x.inner.as_raw();
store
.externref_activations_table()
.insert_with_gc(x.inner, &*store.stack_map_lookup());
.insert_with_gc(x.inner, store.stack_map_lookup());
ptr::write(p as *mut *mut u8, externref_ptr)
}
Val::FuncRef(f) => ptr::write(