mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 22:21:32 +00:00
Added function pointer to the instance functions
This commit is contained in:
@ -119,14 +119,16 @@ impl Instance {
|
|||||||
for (ref func_context, func_offset) in context_and_offsets.iter() {
|
for (ref func_context, func_offset) in context_and_offsets.iter() {
|
||||||
let mut trap_sink = TrapSink::new(*func_offset);
|
let mut trap_sink = TrapSink::new(*func_offset);
|
||||||
let mut reloc_sink = RelocSink::new();
|
let mut reloc_sink = RelocSink::new();
|
||||||
|
let mut func_pointer = (region_start as usize + func_offset) as *mut u8;
|
||||||
unsafe {
|
unsafe {
|
||||||
func_context.emit_to_memory(
|
func_context.emit_to_memory(
|
||||||
&*isa,
|
&*isa,
|
||||||
(region_start as usize + func_offset) as *mut u8,
|
*&mut func_pointer,
|
||||||
&mut reloc_sink,
|
&mut reloc_sink,
|
||||||
&mut trap_sink,
|
&mut trap_sink,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
functions.push(func_pointer as usize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set protection of this memory region to Read + Execute
|
// Set protection of this memory region to Read + Execute
|
||||||
|
Reference in New Issue
Block a user