Skip to content

Commit

Permalink
VM: Determine 64 bit based on sizeof intptr_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvensson committed Oct 22, 2024
1 parent c3b9c43 commit 7586e1d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/vm_interpreted.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@ int VM_CallInterpreted2( vm_t *vm, int nargs, int *args ) {
//vm->programStack = programStack - 4;
vm->programStack = programStack - 8;
*(int *)&image[ programStack + 4 ] = ~r0.i;
{
#if idx64 //__WORDSIZE == 64
if (sizeof(int) != sizeof(intptr_t)) {
// the vm has ints on the stack, we expect
// longs so we have to convert it
intptr_t argarr[16];
Expand All @@ -264,12 +263,10 @@ int VM_CallInterpreted2( vm_t *vm, int nargs, int *args ) {
argarr[ argn ] = *(int*)&image[ programStack + 4 + 4*argn ];
}
v0 = vm->systemCall( &argarr[0] );
#else
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
} else {
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
v0 = vm->systemCall( (intptr_t *)&image[ programStack + 4 ] );
#endif
}

// save return value
//opStack++;
ci = inst + *(int *)&image[ programStack ];
Expand Down

0 comments on commit 7586e1d

Please sign in to comment.