Fix template void return of reference parameter
This commit is contained in:
parent
c3b46d6a78
commit
581137ade7
|
@ -577,16 +577,16 @@ Expression* Expression::ConstantFold(Errors * errors, LinkerSection * dataSectio
|
||||||
uint64 i = 0;
|
uint64 i = 0;
|
||||||
while (i < 64 && rgn->mCartridgeBanks != (1ULL << i))
|
while (i < 64 && rgn->mCartridgeBanks != (1ULL << i))
|
||||||
i++;
|
i++;
|
||||||
if (i < 64)
|
if (i >= 64)
|
||||||
{
|
i = 0xff;
|
||||||
Expression* ex = new Expression(mLocation, EX_CONSTANT);
|
|
||||||
Declaration* dec = new Declaration(mLocation, DT_CONST_INTEGER);
|
Expression* ex = new Expression(mLocation, EX_CONSTANT);
|
||||||
dec->mBase = TheUnsignedCharTypeDeclaration;
|
Declaration* dec = new Declaration(mLocation, DT_CONST_INTEGER);
|
||||||
dec->mInteger = i;
|
dec->mBase = TheUnsignedCharTypeDeclaration;
|
||||||
ex->mDecValue = dec;
|
dec->mInteger = i;
|
||||||
ex->mDecType = dec->mBase;
|
ex->mDecValue = dec;
|
||||||
return ex;
|
ex->mDecType = dec->mBase;
|
||||||
}
|
return ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -2659,7 +2659,8 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
|
||||||
vr = CoerceType(proc, exp, block, inlineMapper, vr, vl.mType);
|
vr = CoerceType(proc, exp, block, inlineMapper, vr, vl.mType);
|
||||||
}
|
}
|
||||||
|
|
||||||
StoreValue(proc, exp, block, inlineMapper, vl, vr);
|
if (vl.mType->mType != DT_TYPE_VOID)
|
||||||
|
StoreValue(proc, exp, block, inlineMapper, vl, vr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4512,7 +4513,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
|
||||||
vr.mReference = 0;
|
vr.mReference = 0;
|
||||||
vr.mType = procType->mBase;
|
vr.mType = procType->mBase;
|
||||||
}
|
}
|
||||||
else
|
else if (vr.mType->mType != DT_TYPE_VOID)
|
||||||
vr = Dereference(proc, exp, block, inlineMapper, vr);
|
vr = Dereference(proc, exp, block, inlineMapper, vr);
|
||||||
|
|
||||||
if (!procType->mBase || procType->mBase->mType == DT_TYPE_VOID)
|
if (!procType->mBase || procType->mBase->mType == DT_TYPE_VOID)
|
||||||
|
|
|
@ -1364,7 +1364,7 @@ Declaration * Parser::ParseFunctionDeclaration(Declaration* bdec)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(adec->mBase->mFlags & DTF_DEFINED) && adec->mBase->mType != DT_TYPE_ARRAY && !adec->mBase->mTemplate)
|
if (adec->mType != DT_PACK_VARIABLE && !(adec->mBase->mFlags & DTF_DEFINED) && adec->mBase->mType != DT_TYPE_ARRAY && !adec->mBase->mTemplate)
|
||||||
mErrors->Error(adec->mLocation, EERR_UNDEFINED_OBJECT, "Type of argument not defined");
|
mErrors->Error(adec->mLocation, EERR_UNDEFINED_OBJECT, "Type of argument not defined");
|
||||||
|
|
||||||
if (adec->mType == DT_PACK_VARIABLE || adec->mType == DT_PACK_ANON)
|
if (adec->mType == DT_PACK_VARIABLE || adec->mType == DT_PACK_ANON)
|
||||||
|
@ -2073,7 +2073,7 @@ Expression* Parser::ParseVarInitExpression(Expression* vexp, bool inner)
|
||||||
|
|
||||||
exp->mDecType = dtype;
|
exp->mDecType = dtype;
|
||||||
}
|
}
|
||||||
else if (dtype->mType == DT_TYPE_AUTO)
|
else if (dtype->mType == DT_TYPE_AUTO || dtype->mType == DT_TYPE_REFERENCE)
|
||||||
{
|
{
|
||||||
exp = ParseRExpression();
|
exp = ParseRExpression();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue