use vm->callLevel to count recursive calls to VM_Call

Throw an error if vm->callLevel is set and VM_Free is called.
This commit is contained in:
Ludwig Nussel 2008-03-24 21:20:55 +00:00
parent 6c5211c0d3
commit 7a5243a3b2
4 changed files with 18 additions and 16 deletions

View file

@ -1069,7 +1069,6 @@ int VM_CallCompiled( vm_t *vm, int *args ) {
currentVM = vm;
++vm->callLevel;
// Com_Printf("entering %s level %d, call %d, arg1 = 0x%x\n", vm->name, vm->callLevel, args[0], args[1]);
// interpret the code
@ -1131,7 +1130,6 @@ int VM_CallCompiled( vm_t *vm, int *args ) {
}
// Com_Printf("exiting %s level %d\n", vm->name, vm->callLevel);
--vm->callLevel;
vm->programStack = stackOnEntry;
return *(int *)opStack;