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_INVALID_NUMBER,
|
||||
EERR_OVERLAPPING_DATA_SECTIONS,
|
||||
EERR_ASSEMBLER_LIMIT,
|
||||
|
||||
EERR_INVALID_PREPROCESSOR,
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ class InterInstruction
|
|||
public:
|
||||
Location mLocation;
|
||||
InterCode mCode;
|
||||
InterOperand mSrc[8];
|
||||
InterOperand mSrc[12];
|
||||
InterOperand mDst;
|
||||
InterOperand mConst;
|
||||
InterOperator mOperator;
|
||||
|
|
|
@ -4055,10 +4055,15 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
|
|||
lins->mSrc[0].mOperandSize = vdec->mSize;
|
||||
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].mTemp = lins->mDst.mTemp;
|
||||
jins->mNumOperands++;
|
||||
}
|
||||
}
|
||||
|
||||
block->Append(jins);
|
||||
|
||||
|
|
Loading…
Reference in New Issue