Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/api/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub(crate) fn from_checked_anyfunc(
store: &Store,
) -> Val {
if item.type_index == wasmtime_runtime::VMSharedSignatureIndex::default() {
Val::AnyRef(AnyRef::Null);
return Val::AnyRef(AnyRef::Null);
}
let instance_handle = unsafe { wasmtime_runtime::InstanceHandle::from_vmctx(item.vmctx) };
let export = wasmtime_runtime::ExportFunction {
Expand Down
1 change: 1 addition & 0 deletions tests/all/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod linker;
mod memory_creator;
mod name;
mod stack_overflow;
mod table;
mod traps;
mod use_after_drop;
mod wast;
13 changes: 13 additions & 0 deletions tests/all/table.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use wasmtime::*;

#[test]
fn get_none() {
let store = Store::default();
let ty = TableType::new(ValType::FuncRef, Limits::new(1, None));
let table = Table::new(&store, ty, Val::AnyRef(AnyRef::Null)).unwrap();
match table.get(0) {
Some(Val::AnyRef(AnyRef::Null)) => {}
_ => panic!(),
}
assert!(table.get(1).is_none());
}