Fix broken test that was creating a stack overflow

This commit is contained in:
Lachlan Sneff
2019-01-12 09:51:25 -05:00
parent e236e2f9b6
commit a3b3523a78
4 changed files with 2 additions and 6 deletions

View File

@ -529,7 +529,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> {
// Get the pointer type based on machine's pointer size. // Get the pointer type based on machine's pointer size.
let ptr_type = self.pointer_type(); let ptr_type = self.pointer_type();
// The `callee` value is an index into a table of function pointers. // The `callee` value is an index into a table of Anyfunc structures.
let entry_addr = pos.ins().table_addr(ptr_type, table, callee, 0); let entry_addr = pos.ins().table_addr(ptr_type, table, callee, 0);
let mflags = ir::MemFlags::trusted(); let mflags = ir::MemFlags::trusted();

View File

@ -31,7 +31,7 @@ fn create_module_1() -> Box<Instance> {
(func (;0;) (type 0) (result i64) (func (;0;) (type 0) (result i64)
i64.const 356) i64.const 356)
(func (;1;) (type 0) (result i64) (func (;1;) (type 0) (result i64)
i32.const 1 i32.const 0
call_indirect (type 0)) call_indirect (type 0))
(table (;0;) 2 anyfunc) (table (;0;) 2 anyfunc)
(export \"type-i64\" (func 1)) (export \"type-i64\" (func 1))

View File

@ -121,8 +121,6 @@ impl LocalBacking {
} }
}; };
println!("func_data: {:#?}", func_data);
elements[init.offset + i] = vm::Anyfunc { func_data, sig_id }; elements[init.offset + i] = vm::Anyfunc { func_data, sig_id };
} }
} }

View File

@ -84,8 +84,6 @@ impl Instance {
) -> Result<Option<Value>, String> { ) -> Result<Option<Value>, String> {
let (func_ref, ctx, signature) = self.get_func_from_index(func_index); let (func_ref, ctx, signature) = self.get_func_from_index(func_index);
println!("func_ref: {:?}", func_ref);
let func_ptr = CodePtr::from_ptr(func_ref.inner() as _); let func_ptr = CodePtr::from_ptr(func_ref.inner() as _);
let vmctx_ptr = match ctx { let vmctx_ptr = match ctx {
Context::External(vmctx) => vmctx, Context::External(vmctx) => vmctx,