qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s);
// LordHavoc: optional runtime bounds checking (speed drain, but worth it for security, on by default - breaks most QCCX features (used by CRMod and others))
+#ifdef PRVM_BOUNDSCHECK_CVAR
cvar_t prvm_boundscheck = {0, "prvm_boundscheck", "1", "enables detection of out of bounds memory access in the QuakeC code being run (in other words, prevents really exceedingly bad QuakeC code from doing nasty things to your computer)"};
+#endif
// LordHavoc: prints every opcode as it executes - warning: this is significant spew
cvar_t prvm_traceqc = {0, "prvm_traceqc", "0", "prints every QuakeC statement as it is executed (only for really thorough debugging!)"};
// LordHavoc: counts usage of each QuakeC statement
Cmd_AddCommand ("menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
Cmd_AddCommand ("sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
// LordHavoc: optional runtime bounds checking (speed drain, but worth it for security, on by default - breaks most QCCX features (used by CRMod and others))
+#ifdef PRVM_BOUNDSCHECK_CVAR
Cvar_RegisterVariable (&prvm_boundscheck);
+#endif
Cvar_RegisterVariable (&prvm_traceqc);
Cvar_RegisterVariable (&prvm_statementprofiling);
Cvar_RegisterVariable (&prvm_backtraceforwarnings);
#define OPA ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->a])
#define OPB ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->b])
#define OPC ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->c])
+#ifdef PRVM_BOUNDSCHECK_CVAR
extern cvar_t prvm_boundscheck;
+#endif
extern cvar_t prvm_traceqc;
extern cvar_t prvm_statementprofiling;
extern sizebuf_t vm_tempstringsbuf;
if (prvm_statementprofiling.integer)
{
#define PRVMSTATEMENTPROFILING 1
+#ifdef PRVM_BOUNDSCHECK_CVAR
if (prvm_boundscheck.integer)
+#endif
{
#define PRVMBOUNDSCHECK 1
if (prog->trace)
}
#undef PRVMBOUNDSCHECK
}
+#ifdef PRVM_BOUNDSCHECK_CVAR
else
{
if (prog->trace)
#include "prvm_execprogram.h"
}
}
+#endif
#undef PRVMSTATEMENTPROFILING
}
else
{
+#ifdef PRVM_BOUNDSCHECK_CVAR
if (prvm_boundscheck.integer)
+#endif
{
#define PRVMBOUNDSCHECK 1
if (prog->trace)
}
#undef PRVMBOUNDSCHECK
}
+#ifdef PRVM_BOUNDSCHECK_CVAR
else
{
if (prog->trace)
#include "prvm_execprogram.h"
}
}
+#endif
}
cleanup: