diff --git a/src/webassembly/instance.rs b/src/webassembly/instance.rs index a7cf4e643..4238b9715 100644 --- a/src/webassembly/instance.rs +++ b/src/webassembly/instance.rs @@ -67,6 +67,7 @@ fn get_function_addr( /// first field #[repr(C)] #[derive(Debug)] +#[repr(C)] pub struct Instance { // C-like pointers to data (heaps, globals, tables) pub data_pointers: DataPointers, @@ -99,6 +100,7 @@ pub struct Instance { /// NOTE: Rearranging the fields will break the memory arrangement model #[repr(C)] #[derive(Debug)] +#[repr(C)] pub struct DataPointers { // Pointer to tables pub tables: TablesSlice, diff --git a/src/webassembly/module.rs b/src/webassembly/module.rs index acc91a339..f48506872 100644 --- a/src/webassembly/module.rs +++ b/src/webassembly/module.rs @@ -489,6 +489,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { .special_param(ir::ArgumentPurpose::VMContext) .expect("Missing vmctx parameter"); + // The `callee` value is an index into a table of function pointers. // Apparently, that table is stored at absolute address 0 in this dummy environment. // TODO: Generate bounds checking code. @@ -537,6 +538,9 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { .special_param(ir::ArgumentPurpose::VMContext) .expect("Missing vmctx parameter"); + // println!("POINTER BYTES {}", self.pointer_bytes()); + // println!("POINTER SIZE {}", self.ptr_size()); + // Build a value list for the call instruction containing the call_args and the vmctx // parameter. let mut args = ir::ValueList::default();