From 8a18ecb9614de35847a0a9da3a2b3e80608baba2 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sun, 6 Nov 2005 13:46:17 +0000 Subject: [PATCH] - fall back to interpreter if VM_Compile resets vm->compiled --- code/qcommon/vm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c index 8f3e7a33..d241af80 100644 --- a/code/qcommon/vm.c +++ b/code/qcommon/vm.c @@ -574,6 +574,8 @@ vm_t *VM_Create( const char *module, long (*systemCalls)(long *), // copy or compile the instructions vm->codeLength = header->codeLength; + vm->compiled = qfalse; + #ifdef NO_VM_COMPILED if(interpret >= VMI_COMPILED) { Com_Printf("Architecture doesn't have a bytecode compiler, using interpreter\n"); @@ -583,10 +585,11 @@ vm_t *VM_Create( const char *module, long (*systemCalls)(long *), if ( interpret >= VMI_COMPILED ) { vm->compiled = qtrue; VM_Compile( vm, header ); - } else + } #endif + // VM_Compile may have reset vm->compiled if compilation failed + if (!vm->compiled) { - vm->compiled = qfalse; VM_PrepareInterpreter( vm, header ); }