mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
progs.h:
add no_exec_limit field. Set to 1 to disable the runaway loop check for unlimited runs (eg, in qwaq) pr_exec.c: don't bother checking the profile counter if pr->no_exec_limit is set pr_strings.c: free unreferenced dynamic strings rather than referenced.
This commit is contained in:
parent
22f465dabe
commit
2bc94ea66f
3 changed files with 5 additions and 4 deletions
|
@ -168,6 +168,7 @@ eval_t *GetEdictFieldValue(progs_t *pr, edict_t *ed, char *field);
|
|||
|
||||
char *PR_GetString(progs_t *pr, int num);
|
||||
int PR_SetString(progs_t *pr, char *s);
|
||||
void PR_GarbageCollect (progs_t *pr);
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
@ -228,6 +229,7 @@ struct progs_s {
|
|||
int *reserved_edicts; //alloc will start at reserved_edicts+1
|
||||
double *time;
|
||||
int null_bad;
|
||||
int no_exec_limit;
|
||||
|
||||
unsigned short crc;
|
||||
|
||||
|
|
|
@ -379,9 +379,8 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
|
|||
|
||||
while (1) {
|
||||
st++;
|
||||
if (++profile > 1000000) // LordHavoc: increased runaway loop
|
||||
// limit 10x
|
||||
{
|
||||
if (!pr->no_exec_limit
|
||||
&& ++profile > 1000000) {
|
||||
pr->pr_xstatement = st - pr->pr_statements;
|
||||
PR_RunError (pr, "runaway loop error");
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ PR_GarbageCollect (progs_t *pr)
|
|||
}
|
||||
}
|
||||
for (sr = pr->dynamic_strings.next; sr; sr = sr->next) {
|
||||
if (sr->count) {
|
||||
if (!sr->count) {
|
||||
Hash_Del (pr->strref_hash, sr->string);
|
||||
strref_free (sr, pr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue