Line 0
Link Here
|
|
|
1 |
--- code/qcommon/vm_interpreted.c 2009/11/01 19:58:07 1717 |
2 |
+++ code/qcommon/vm_interpreted.c 2010/01/16 10:55:51 1772 |
3 |
@@ -516,18 +516,20 @@ |
4 |
|
5 |
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] ); |
6 |
{ |
7 |
- intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ]; |
8 |
- #if __WORDSIZE == 64 |
9 |
- // the vm has ints on the stack, we expect |
10 |
- // longs so we have to convert it |
11 |
- intptr_t argarr[16]; |
12 |
- int i; |
13 |
- for (i = 0; i < 16; ++i) { |
14 |
- argarr[i] = *(int*)&image[ programStack + 4 + 4*i ]; |
15 |
+ // the vm has ints on the stack, we expect |
16 |
+ // pointers so we might have to convert it |
17 |
+ if (sizeof(intptr_t) != sizeof(int)) { |
18 |
+ intptr_t argarr[16]; |
19 |
+ int *imagePtr = (int *)&image[programStack]; |
20 |
+ int i; |
21 |
+ for (i = 0; i < 16; ++i) { |
22 |
+ argarr[i] = *(++imagePtr); |
23 |
+ } |
24 |
+ r = vm->systemCall( argarr ); |
25 |
+ } else { |
26 |
+ intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ]; |
27 |
+ r = vm->systemCall( argptr ); |
28 |
} |
29 |
- argptr = argarr; |
30 |
- #endif |
31 |
- r = vm->systemCall( argptr ); |
32 |
} |
33 |
|
34 |
#ifdef DEBUG_VM |