So I am following a guide on how to do a simple JIT from here (https://www.youtube.com/watch?v=8mxubNQC5O8)
In his code he does
void run(VM& vm) {
typedef void (*JittedFunction)(VM&, Value* registers, Value* locals);
(*(JittedFunction)code)(vm, vm.registers.data(), vm.locals.data());
}```
and in mine I try to
```rs
pub fn run(self: *@This(), vm: *VM) !void {
// RDI: VM&
// RSI: Value* registers
// RDX: Value* locals
const func: *const fn (vm: *VM, regs: [*]Value, locals: [*]Value) void = @alignCast(@ptrCast(self.code));
@call(.auto, func, .{ vm, vm.registers.items.ptr, vm.locals.items.ptr });
}```
Im wondering if I am calling my jit wrong, or my assembly is wrong.
My entire code is available here: https://zigbin.io/3dd803
Exit error:
```rs
Segmentation fault at address 0x0
???:?:?: 0x7aff72b53067 in ??? (???)
Unwind information for `???:0x7aff72b53067` was not available, trace may be incomplete
Assembly (nbdisasm -b64 of the code): https://zigbin.io/fd4b6c