diff options
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index d05552b9..8afd52b2 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -271,7 +271,7 @@ bool Compiler::visit(Return& _return) { ExpressionCompiler::compileExpression(m_context, *expression); VariableDeclaration const& firstVariable = *_return.getFunctionReturnParameters().getParameters().front(); - ExpressionCompiler::cleanHigherOrderBitsIfNeeded(*expression->getType(), *firstVariable.getType()); + ExpressionCompiler::appendTypeConversion(m_context, *expression->getType(), *firstVariable.getType()); int stackPosition = m_context.getStackPositionOfVariable(firstVariable); m_context << eth::swapInstruction(stackPosition) << eth::Instruction::POP; } @@ -284,8 +284,9 @@ bool Compiler::visit(VariableDefinition& _variableDefinition) if (Expression* expression = _variableDefinition.getExpression()) { ExpressionCompiler::compileExpression(m_context, *expression); - ExpressionCompiler::cleanHigherOrderBitsIfNeeded(*expression->getType(), - *_variableDefinition.getDeclaration().getType()); + ExpressionCompiler::appendTypeConversion(m_context, + *expression->getType(), + *_variableDefinition.getDeclaration().getType()); int stackPosition = m_context.getStackPositionOfVariable(_variableDefinition.getDeclaration()); m_context << eth::swapInstruction(stackPosition) << eth::Instruction::POP; } |