Skip to content

Commit

Permalink
Fix PR2 segfault when compiling with clang and -O2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Bolsunov committed Jul 25, 2024
1 parent 5e3a784 commit 611e23d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int nargs, int callnum, ... )
if ( vm->entryPoint )
{
//rcg010207 - see dissertation at top of VM_DllSyscall() in this file.
int args[MAX_VMMAIN_CALL_ARGS-1];
int args[MAX_VMMAIN_CALL_ARGS-1] = {0};
va_list ap;
va_start( ap, callnum );
for ( i = 0; i < nargs; i++ ) {
Expand All @@ -1467,7 +1467,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int nargs, int callnum, ... )
#endif
r = VM_CallInterpreted2( vm, nargs+1, (int*)&callnum );
#else
int args[MAX_VMMAIN_CALL_ARGS];
int args[MAX_VMMAIN_CALL_ARGS] = {0};
va_list ap;

args[0] = callnum;
Expand Down

0 comments on commit 611e23d

Please sign in to comment.