- fall back to interpreter if VM_Compile resets vm->compiled

This commit is contained in:
Ludwig Nussel 2005-11-06 13:46:17 +00:00
parent 87b12105bc
commit 8a18ecb961

View file

@ -574,6 +574,8 @@ vm_t *VM_Create( const char *module, long (*systemCalls)(long *),
// copy or compile the instructions // copy or compile the instructions
vm->codeLength = header->codeLength; vm->codeLength = header->codeLength;
vm->compiled = qfalse;
#ifdef NO_VM_COMPILED #ifdef NO_VM_COMPILED
if(interpret >= VMI_COMPILED) { if(interpret >= VMI_COMPILED) {
Com_Printf("Architecture doesn't have a bytecode compiler, using interpreter\n"); 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 ) { if ( interpret >= VMI_COMPILED ) {
vm->compiled = qtrue; vm->compiled = qtrue;
VM_Compile( vm, header ); VM_Compile( vm, header );
} else }
#endif #endif
// VM_Compile may have reset vm->compiled if compilation failed
if (!vm->compiled)
{ {
vm->compiled = qfalse;
VM_PrepareInterpreter( vm, header ); VM_PrepareInterpreter( vm, header );
} }