From 91ae99ca4e1de95b54d9d3756f1c85a0abad4576 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 15 Dec 2012 21:55:07 +0000 Subject: Fix passing arg9 (qvm only), arg10, and arg11 to vmMain for native libs and non-i386 compiled or interpated qvms. (Currently they aren't use in vmMain in game, cgame, or ui.) Fix passing args[11] to args[15] from vm to engine on ppc64 and sparc64. Some of the args are used by game bot prediction syscalls. May have been causing bugs. Note: This was fixed for x86_64 in r2163. --- src/qcommon/vm_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qcommon/vm_powerpc.c') diff --git a/src/qcommon/vm_powerpc.c b/src/qcommon/vm_powerpc.c index 604d844e..4bc3354e 100644 --- a/src/qcommon/vm_powerpc.c +++ b/src/qcommon/vm_powerpc.c @@ -367,13 +367,13 @@ VM_AsmCall( int callSyscallInvNum, int callProgramStack ) ret = currentVM->systemCall( argPosition ); } else { - intptr_t args[11]; + intptr_t args[MAX_VMSYSCALL_ARGS]; // generated code does not invert syscall number args[0] = -1 - callSyscallInvNum; int *argPosition = (int *)((byte *)currentVM->dataBase + callProgramStack + 4); - for( i = 1; i < 11; i++ ) + for( i = 1; i < ARRAY_LEN(args); i++ ) args[ i ] = argPosition[ i ]; ret = currentVM->systemCall( args ); @@ -2105,9 +2105,9 @@ VM_CallCompiled( vm_t *vm, int *args ) vm->currentlyInterpreting = qtrue; - programStack -= 48; + programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS ); argPointer = (int *)&image[ programStack + 8 ]; - memcpy( argPointer, args, 4 * 9 ); + memcpy( argPointer, args, 4 * MAX_VMMAIN_ARGS ); argPointer[ -1 ] = 0; argPointer[ -2 ] = -1; -- cgit