From 2409247307a2fdf0266a8bd7cd39526f06bea0d3 Mon Sep 17 00:00:00 2001 From: tma Date: Thu, 13 Oct 2005 14:47:00 +0000 Subject: * (Non-trivial) fix to the "opStack corrupted in compiled code" bug git-svn-id: svn://svn.icculus.org/quake3/trunk@156 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/vm_x86.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'code/qcommon/vm_x86.c') diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index a46161a..63b3e1b 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -419,6 +419,12 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { Com_Memset(jused, 0, header->instructionCount+2); + // ensure that the optimisation pass knows about all the jump + // table targets + for( i = 0; i < vm->numJumpTableTargets; i++ ) { + jused[ *(int *)(vm->jumpTableTargets + ( i * sizeof( int ) ) ) ] = 1; + } + for(pass=0;pass<2;pass++) { oc0 = -23423; oc1 = -234354; -- cgit v1.2.3