diff --git a/oscar64/InterCodeGenerator.cpp b/oscar64/InterCodeGenerator.cpp index e611c83..42e84e5 100644 --- a/oscar64/InterCodeGenerator.cpp +++ b/oscar64/InterCodeGenerator.cpp @@ -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);