]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_exec.c
Don't crash the game if a "nasty" -game name is rejected, matches behavior of missing...
[xonotic/darkplaces.git] / prvm_exec.c
index b6766757d5a38dfb358b90564a525c5598f2b30e..452f2803f1b780c3dd1ca70cd0c45b7af03c7308 100644 (file)
@@ -716,13 +716,15 @@ static void PRVM_StatementCoverageEvent(prvm_prog_t *prog, mfunction_t *func, in
        Con_Printf("prvm_coverage: %s just executed a statement at %s for the first time. Coverage: %.2f%%.\n", prog->name, PRVM_WhereAmI(vabuf, sizeof(vabuf), prog, func, statement), prog->statements_covered * 100.0 / prog->numstatements);
 }
 
-#if defined (__GNUC__) && (_GNU_SOURCE)
-#define HAVE_COMPUTED_GOTOS 1
+#if defined (__GNUC__) || (__clang__) || (__TINYC__)
+#  ifndef CONFIG_PEDANTIC
+#  define HAVE_COMPUTED_GOTOS 1
+#  endif
 #endif
 
-#define OPA ((prvm_eval_t *)&prog->globals.fp[st->operand[0]])
-#define OPB ((prvm_eval_t *)&prog->globals.fp[st->operand[1]])
-#define OPC ((prvm_eval_t *)&prog->globals.fp[st->operand[2]])
+#define OPA ((prvm_eval_t *)&globals[st->operand[0]])
+#define OPB ((prvm_eval_t *)&globals[st->operand[1]])
+#define OPC ((prvm_eval_t *)&globals[st->operand[2]])
 extern cvar_t prvm_traceqc;
 extern cvar_t prvm_statementprofiling;
 extern qboolean prvm_runawaycheck;
@@ -759,6 +761,8 @@ void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessag
        qboolean cached_allowworldwrites = prog->allowworldwrites;
        unsigned int cached_flag = prog->flag;
 
+       prvm_vec_t *globals = prog->globals.fp;
+
        calltime = Sys_DirtyTime();
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
@@ -866,6 +870,8 @@ void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa
        qboolean cached_allowworldwrites = prog->allowworldwrites;
        unsigned int cached_flag = prog->flag;
 
+       prvm_vec_t *globals = prog->globals.fp;
+
        calltime = Sys_DirtyTime();
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
@@ -977,6 +983,8 @@ void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa
        qboolean cached_allowworldwrites = prog->allowworldwrites;
        unsigned int cached_flag = prog->flag;
 
+       prvm_vec_t *globals = prog->globals.fp;
+
        calltime = Sys_DirtyTime();
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)