diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index 77aba05b..3ec42eeb 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -412,23 +412,24 @@ static void DoSyscall(void) if(vm_syscallNum < 0) { - int *data; + int *data, *ret; #if idx64 int index; intptr_t args[MAX_VMSYSCALL_ARGS]; #endif data = (int *) (savedVM->dataBase + vm_programStack + 4); + ret = &vm_opStackBase[vm_opStackOfs + 1]; #if idx64 args[0] = ~vm_syscallNum; for(index = 1; index < ARRAY_LEN(args); index++) args[index] = data[index]; - vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall(args); + *ret = savedVM->systemCall(args); #else data[0] = ~vm_syscallNum; - vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall((intptr_t *) data); + *ret = savedVM->systemCall((intptr_t *) data); #endif } else