mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-25 09:49:27 +00:00
Add dereferenceable attribute to the vmctx pointer.
This commit is contained in:
@ -34,7 +34,7 @@ use wasmer_types::{
|
||||
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, SignatureIndex,
|
||||
TableIndex, Type,
|
||||
};
|
||||
use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle};
|
||||
use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle, VMOffsets};
|
||||
|
||||
const FUNCTION_SECTION: &str = "__TEXT,wasmer_function";
|
||||
|
||||
@ -101,10 +101,12 @@ impl FuncTranslator {
|
||||
.get(wasm_module.functions[func_index])
|
||||
.unwrap();
|
||||
|
||||
// TODO: pointer width
|
||||
let offsets = VMOffsets::new(8, &wasm_module);
|
||||
let intrinsics = Intrinsics::declare(&module, &self.ctx);
|
||||
let (func_type, func_attrs) =
|
||||
self.abi
|
||||
.func_type_to_llvm(&self.ctx, &intrinsics, wasm_fn_type)?;
|
||||
.func_type_to_llvm(&self.ctx, &intrinsics, Some(&offsets), wasm_fn_type)?;
|
||||
|
||||
let func = module.add_function(&function_name, func_type, Some(Linkage::External));
|
||||
for (attr, attr_loc) in &func_attrs {
|
||||
@ -2350,9 +2352,12 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
self.builder.build_unreachable();
|
||||
self.builder.position_at_end(continue_block);
|
||||
|
||||
let (llvm_func_type, llvm_func_attrs) =
|
||||
self.abi
|
||||
.func_type_to_llvm(&self.context, &self.intrinsics, func_type)?;
|
||||
let (llvm_func_type, llvm_func_attrs) = self.abi.func_type_to_llvm(
|
||||
&self.context,
|
||||
&self.intrinsics,
|
||||
Some(self.ctx.get_offsets()),
|
||||
func_type,
|
||||
)?;
|
||||
|
||||
let params = self.state.popn_save_extra(func_type.params().len())?;
|
||||
|
||||
|
Reference in New Issue
Block a user