Add constexpr pointers for inline assembler

This commit is contained in:
drmortalwombat 2024-05-19 22:20:52 +02:00
parent 1b22a5e3c5
commit a2a22476ed

View File

@ -10363,6 +10363,29 @@ Expression* Parser::ParseAssemblerBaseOperand(Declaration* pcasm, int pcoffset)
{
exp->mDecType = TheUnsignedIntTypeDeclaration;
}
else if (dec->mType == DT_VARIABLE && (dec->mFlags & DTF_CONSTEXPR) && dec->mValue && dec->mValue->mType == EX_CONSTANT)
{
Declaration* dt = dec->mValue->mDecValue;
if (dt->mType == DT_CONST_INTEGER)
{
exp->mDecValue = dt;
exp->mDecType = dt->mBase;
mScanner->NextToken();
return exp;
}
else if (dt->mType == DT_CONST_ADDRESS)
{
dec = new Declaration(mScanner->mLocation, DT_CONST_INTEGER);
dec->mInteger = dt->mInteger;
dec->mBase = TheUnsignedIntTypeDeclaration;
exp->mDecValue = dec;
exp->mDecType = TheUnsignedIntTypeDeclaration;
mScanner->NextToken();
return exp;
}
exp->mDecType = TheUnsignedIntTypeDeclaration;
}
else if (dec->mType == DT_CONST_ASSEMBLER)
{
exp->mDecType = dec->mBase;