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
This commit is contained in:
Spoike 2020-08-16 04:41:11 +00:00
parent 0c0b6c3ed0
commit da6b6c3e6c
2 changed files with 5 additions and 3 deletions

View File

@ -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 //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) 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; return nullsref;
} }
ctx.func = &functions[eval->function]; 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.fdef = fdef.sym;
ctx.result = nullsref; ctx.result = nullsref;
ctx.error = NULL;
if ((int)ctx.func->code <= 0) if ((int)ctx.func->code <= 0)
{ {
char *fname = ctx.func->name; 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 type = QCC_PR_ParseType(false, true); //legacy behaviour
if (type) 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; basetype = type;
} }
else else

View File

@ -226,6 +226,7 @@ struct {
{" F325", WARN_NESTEDCOMMENT}, {" F325", WARN_NESTEDCOMMENT},
{" F326", WARN_DEPRECATEDVARIABLE}, {" F326", WARN_DEPRECATEDVARIABLE},
{" F327", WARN_ENUMFLAGS_NOTINTEGER}, {" F327", WARN_ENUMFLAGS_NOTINTEGER},
{" F328", WARN_DEPRECACTEDSYNTAX},
{" F207", WARN_NOTREFERENCEDFIELD}, {" F207", WARN_NOTREFERENCEDFIELD},
{" F208", WARN_NOTREFERENCEDCONST}, {" F208", WARN_NOTREFERENCEDCONST},
@ -4610,7 +4611,7 @@ static void QCC_SetDefaultProperties (void)
targ = QCF_DARKPLACES; targ = QCF_DARKPLACES;
else else
targ = QCF_STANDARD; targ = QCF_STANDARD;
QCC_OPCodeSetTarget(targ, 0x7fffffff); QCC_OPCodeSetTarget(targ, 0);
} }