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.
This commit is contained in:
Zack Middleton 2012-12-15 21:55:07 +00:00
parent b943d506bf
commit c5af65fe5f
7 changed files with 43 additions and 53 deletions

View file

@ -808,11 +808,11 @@ static int asmcall(int call, int pstack)
argPosition[0] = -1 - call;
ret = currentVM->systemCall(argPosition);
} else {
intptr_t args[11];
intptr_t args[MAX_VMSYSCALL_ARGS];
args[0] = -1 - call;
int *argPosition = (int *)((byte *)currentVM->dataBase + pstack + 4);
for( i = 1; i < 11; i++ )
for( i = 1; i < ARRAY_LEN(args); i++ )
args[i] = argPosition[i];
ret = currentVM->systemCall(args);
@ -1650,9 +1650,9 @@ int 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;