Con_Print("prvm_profile <program name>\n");
return;
}
-
+
PRVM_Begin;
if(!PRVM_SetProgFromString(Cmd_Argv(1)))
return;
num++;
best->profile = 0;
best->builtinsprofile = 0;
+ best->callcount = 0;
}
} while (best);
PRVM_SetProg(i);
PRVM_Crash();
}
-
+
prog = oldprog;
}
void PRVM_Crash()
{
+ if (prog == NULL)
+ return;
- //TODO: make this more compilant with PR_Crash
- if (prog->depth < 1)
+ if( prog->depth > 0 )
{
- // kill the stack just to be sure
- prog->depth = 0;
- prog->localstack_used = 0;
- return;
+ Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
+ PRVM_PrintState();
}
- Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
- PRVM_PrintState();
-
// dump the stack so host_error can shutdown functions
prog->depth = 0;
prog->localstack_used = 0;
+ // reset the prog pointer
+ prog = NULL;
}
/*
extern cvar_t prvm_boundscheck;
extern cvar_t prvm_traceqc;
extern int PRVM_ED_FindFieldOffset (const char *field);
-extern ddef_t* PRVM_ED_FindGlobal(const char *name);
+extern ddef_t* PRVM_ED_FindGlobal(const char *name);
void PRVM_ExecuteProgram (func_t fnum, const char *errormessage)
{
dstatement_t *st;