diff options
Diffstat (limited to 'code/qcommon/vm_interpreted.c')
| -rw-r--r-- | code/qcommon/vm_interpreted.c | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c index e2d69a7..1989a5d 100644 --- a/code/qcommon/vm_interpreted.c +++ b/code/qcommon/vm_interpreted.c @@ -518,7 +518,20 @@ nextInstruction2:  				*(int *)&image[ programStack + 4 ] = -1 - programCounter;  //VM_LogSyscalls( (int *)&image[ programStack + 4 ] ); -				r = vm->systemCall( (int *)&image[ programStack + 4 ] ); +				{ +					long* argptr = (long *)&image[ programStack + 4 ]; +				#if __WORDSIZE == 64 +				// the vm has ints on the stack, we expect +				// longs so we have to convert it +					long argarr[16]; +					int i; +					for (i = 0; i < 16; ++i) { +						argarr[i] = *(int*)&image[ programStack + 4 + 4*i ]; +						argptr = argarr; +					} +				#endif +					r = vm->systemCall( argptr ); +				}  #ifdef DEBUG_VM  				// this is just our stack frame pointer, only needed | 
