diff options
author | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-03-24 21:20:55 +0000 |
---|---|---|
committer | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-03-24 21:20:55 +0000 |
commit | 07e86d96ebda4c67d32997bdba667af58023fcea (patch) | |
tree | 9f7097a58384fb58cc7b19cfded69c66f10a83b6 /code/qcommon/vm_interpreted.c | |
parent | 000148b66c80c177a2491bfc8b979415166d1e75 (diff) | |
download | ioquake3-aero-07e86d96ebda4c67d32997bdba667af58023fcea.tar.gz ioquake3-aero-07e86d96ebda4c67d32997bdba667af58023fcea.zip |
use vm->callLevel to count recursive calls to VM_Call
Throw an error if vm->callLevel is set and VM_Free is called.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1274 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/vm_interpreted.c')
-rw-r--r-- | code/qcommon/vm_interpreted.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c index 3a41e6b..897da68 100644 --- a/code/qcommon/vm_interpreted.c +++ b/code/qcommon/vm_interpreted.c @@ -376,8 +376,6 @@ int VM_CallInterpreted( vm_t *vm, int *args ) { *(int *)&image[ programStack + 4 ] = 0; // return stack *(int *)&image[ programStack ] = -1; // will terminate the loop on return - vm->callLevel = 0; - VM_Debug(0); // vm_debugLevel=2; @@ -516,7 +514,7 @@ nextInstruction2: if ( programCounter < 0 ) { // system call int r; - int temp; +// int temp; #ifdef DEBUG_VM int stomped; @@ -525,7 +523,7 @@ nextInstruction2: } #endif // save the stack to allow recursive VM entry - temp = vm->callLevel; +// temp = vm->callLevel; vm->programStack = programStack - 4; #ifdef DEBUG_VM stomped = *(int *)&image[ programStack + 4 ]; @@ -558,7 +556,7 @@ nextInstruction2: opStack++; *opStack = r; programCounter = *(int *)&image[ programStack ]; - vm->callLevel = temp; +// vm->callLevel = temp; #ifdef DEBUG_VM if ( vm_debugLevel ) { Com_Printf( "%s<--- %s\n", DEBUGSTR, VM_ValueToSymbol( vm, programCounter ) ); @@ -599,7 +597,7 @@ nextInstruction2: // vm_debugLevel = 2; // VM_StackTrace( vm, programCounter, programStack ); } - vm->callLevel++; +// vm->callLevel++; } #endif goto nextInstruction; @@ -614,7 +612,7 @@ nextInstruction2: #ifdef DEBUG_VM profileSymbol = VM_ValueToFunctionSymbol( vm, programCounter ); if ( vm_debugLevel ) { - vm->callLevel--; +// vm->callLevel--; Com_Printf( "%s<--- %s\n", DEBUGSTR, VM_ValueToSymbol( vm, programCounter ) ); } #endif |