Add error when exceeding assembler limits
This commit is contained in:
parent
a2a22476ed
commit
4fb35a7af2
|
@ -105,6 +105,7 @@ enum ErrorID
|
||||||
ERRR_STACK_OVERFLOW,
|
ERRR_STACK_OVERFLOW,
|
||||||
ERRR_INVALID_NUMBER,
|
ERRR_INVALID_NUMBER,
|
||||||
EERR_OVERLAPPING_DATA_SECTIONS,
|
EERR_OVERLAPPING_DATA_SECTIONS,
|
||||||
|
EERR_ASSEMBLER_LIMIT,
|
||||||
|
|
||||||
EERR_INVALID_PREPROCESSOR,
|
EERR_INVALID_PREPROCESSOR,
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ class InterInstruction
|
||||||
public:
|
public:
|
||||||
Location mLocation;
|
Location mLocation;
|
||||||
InterCode mCode;
|
InterCode mCode;
|
||||||
InterOperand mSrc[8];
|
InterOperand mSrc[12];
|
||||||
InterOperand mDst;
|
InterOperand mDst;
|
||||||
InterOperand mConst;
|
InterOperand mConst;
|
||||||
InterOperator mOperator;
|
InterOperator mOperator;
|
||||||
|
|
|
@ -4055,10 +4055,15 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
|
||||||
lins->mSrc[0].mOperandSize = vdec->mSize;
|
lins->mSrc[0].mOperandSize = vdec->mSize;
|
||||||
block->Append(lins);
|
block->Append(lins);
|
||||||
|
|
||||||
|
if (jins->mNumOperands >= 12)
|
||||||
|
mErrors->Error(exp->mLocation, EERR_ASSEMBLER_LIMIT, "Maximum number of variables in assembler block exceeded", vdec->mIdent);
|
||||||
|
else
|
||||||
|
{
|
||||||
jins->mSrc[jins->mNumOperands].mType = InterTypeOf(vdec->mBase);
|
jins->mSrc[jins->mNumOperands].mType = InterTypeOf(vdec->mBase);
|
||||||
jins->mSrc[jins->mNumOperands].mTemp = lins->mDst.mTemp;
|
jins->mSrc[jins->mNumOperands].mTemp = lins->mDst.mTemp;
|
||||||
jins->mNumOperands++;
|
jins->mNumOperands++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
block->Append(jins);
|
block->Append(jins);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue