Fix reference to value cast

This commit is contained in:
drmortalwombat 2025-05-05 11:44:10 +02:00
parent fccfe35c4f
commit 0a9c43757a

View File

@ -5111,13 +5111,16 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
break;
}
case EX_TYPECAST:
{
vr = TranslateExpression(procType, proc, block, exp->mLeft, destack, gotos, breakBlock, continueBlock, inlineMapper);
InterInstruction * ins = new InterInstruction(MapLocation(exp, inlineMapper), IC_CONVERSION_OPERATOR);
if (vr.mType->IsReference() && !exp->mDecType->IsReference())
vr = ToValue(proc, exp, block, inlineMapper, vr);
if (exp->mDecType->mType == DT_TYPE_FLOAT && vr.mType->IsIntegerType())
{
vr = Dereference(proc, exp, block, inlineMapper, vr);