Fix error message when propagating invalid function parameter to const

This commit is contained in:
drmortalwombat 2024-01-08 18:20:55 +01:00
parent 7f31ee9c71
commit 1abdd1476e

View File

@ -759,7 +759,7 @@ Declaration* GlobalOptimizer::Analyze(Expression* exp, Declaration* procDec, uin
} }
if (!(pdec->mFlags & DTF_FPARAM_UNUSED) && !(pdec->mOptFlags & OPTF_VAR_NOCONST)) if (!(pdec->mFlags & DTF_FPARAM_UNUSED) && !(pdec->mOptFlags & OPTF_VAR_NOCONST))
{ {
if (pex->mType == EX_CONSTANT && pdec->mBase->IsSimpleType()) if (pex->mType == EX_CONSTANT && pdec->mBase->IsSimpleType() && pdec->mBase->CanAssign(pex->mDecType))
{ {
if (pdec->mOptFlags & OPTF_VAR_CONST) if (pdec->mOptFlags & OPTF_VAR_CONST)
{ {