feat(jit): fix segfault
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use inkwell::AddressSpace;
|
||||
use inkwell::context::Context;
|
||||
use inkwell::execution_engine::ExecutionEngine;
|
||||
use inkwell::module::{Linkage, Module};
|
||||
use inkwell::module::Module;
|
||||
use inkwell::types::{FloatType, FunctionType, IntType, PointerType, StructType};
|
||||
use inkwell::values::{BasicValueEnum, FunctionValue};
|
||||
|
||||
@@ -194,7 +194,9 @@ extern "C" fn helper_add(lhs: JITValue, rhs: JITValue) -> JITValue {
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn helper_call(vm: *const VM<'_>, env: *const Env<'_>, func_ptr: *const (), arg: JITValue) -> JITValue {
|
||||
extern "C" fn helper_call<'jit, 'vm>(vm: *const VM<'jit>, env: *const Env<'jit, 'vm>, func_ptr: *const (), arg: JITValue) -> JITValue {
|
||||
let func: JITFunc = unsafe { std::mem::transmute(func_ptr) };
|
||||
func(vm, env, arg)
|
||||
unsafe {
|
||||
func(vm, env, arg)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user