Fix crash compiling indexed memcpy size

This commit is contained in:
drmortalwombat 2022-04-25 21:22:25 +02:00
parent f619c5e0ab
commit 7aec7f5c50
2 changed files with 4 additions and 2 deletions

View File

@ -364,7 +364,9 @@ Declaration * GlobalAnalyzer::Analyze(Expression* exp, Declaration* procDec)
if (ldec->mType == DT_VARIABLE || ldec->mType == DT_ARGUMENT)
ldec = ldec->mBase;
rdec = Analyze(exp->mRight, procDec);
return ldec->mBase;
if (ldec->mBase)
return ldec->mBase;
break;
case EX_QUALIFY:
Analyze(exp->mLeft, procDec);
return exp->mDecValue->mBase;

View File

@ -1990,7 +1990,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
if (exp->mRight->mType == EX_LIST)
{
Expression* tex = exp->mRight->mLeft, * sex = exp->mRight->mRight->mLeft, * nex = exp->mRight->mRight->mRight;
if (nex->mDecValue->mType == DT_CONST_INTEGER && nex->mDecValue->mInteger < 128)
if (nex->mType == EX_CONSTANT && nex->mDecValue->mType == DT_CONST_INTEGER && nex->mDecValue->mInteger < 128)
{
vl = TranslateExpression(procType, proc, block, tex, breakBlock, continueBlock, inlineMapper);
if (vl.mType->mType == DT_TYPE_ARRAY)