From da6b6c3e6ccf8ef8c5a48aa4a6980321c2cf37de Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 16 Aug 2020 04:41:11 +0000 Subject: [PATCH] qcc: Avoid crashing from trying to warn about uninlinable inlines. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5747 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 5 +++-- engine/qclib/qccmain.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 60ad23bd..7ea9a745 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -5811,7 +5811,7 @@ static QCC_sref_t QCC_PR_Inline(QCC_sref_t fdef, QCC_ref_t **arglist, unsigned i //make sure that its a function type and that there's no special weirdness if (!eval || eval->function < 0 || argcount > 8 || eval->function >= numfunctions || fdef.sym->arraysize != 0 || fdef.cast->type != ev_function || argcount != fdef.cast->num_parms || fdef.cast->vargs || fdef.cast->vargcount) { - QCC_PR_ParseWarning(0, "Couldn't inline \"%s\": %s", ctx.func->name, "inconsistent context"); + QCC_PR_ParseWarning(0, "Couldn't inline \"%s\": %s", fdef.sym->name, "inconsistent context"); return nullsref; } ctx.func = &functions[eval->function]; @@ -5828,6 +5828,7 @@ static QCC_sref_t QCC_PR_Inline(QCC_sref_t fdef, QCC_ref_t **arglist, unsigned i } ctx.fdef = fdef.sym; ctx.result = nullsref; + ctx.error = NULL; if ((int)ctx.func->code <= 0) { char *fname = ctx.func->name; @@ -15945,7 +15946,7 @@ QCC_type_t *QCC_PR_ParseEnum(pbool flags) type = QCC_PR_ParseType(false, true); //legacy behaviour if (type) { - QCC_PR_ParseWarning(WARN_DEPRECACTEDSYNTAX, "legacy enum base type. Use \"enum [class] [name_e]:type\" instead\n"); + QCC_PR_ParseWarning(WARN_DEPRECACTEDSYNTAX, "legacy enum base type. Use \"enum [class] [name_e]:type\" instead"); basetype = type; } else diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index 950a42e3..d96cf8ee 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -226,6 +226,7 @@ struct { {" F325", WARN_NESTEDCOMMENT}, {" F326", WARN_DEPRECATEDVARIABLE}, {" F327", WARN_ENUMFLAGS_NOTINTEGER}, + {" F328", WARN_DEPRECACTEDSYNTAX}, {" F207", WARN_NOTREFERENCEDFIELD}, {" F208", WARN_NOTREFERENCEDCONST}, @@ -4610,7 +4611,7 @@ static void QCC_SetDefaultProperties (void) targ = QCF_DARKPLACES; else targ = QCF_STANDARD; - QCC_OPCodeSetTarget(targ, 0x7fffffff); + QCC_OPCodeSetTarget(targ, 0); }