diff options
author | Christian <c@ethdev.com> | 2014-11-07 09:13:31 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-07 09:13:31 +0800 |
commit | dc8fb45e1f1d098442458f14d80c343e4a445619 (patch) | |
tree | ce2bbcf7ce70813ce6f891e1df5408428cecdd77 /Compiler.cpp | |
parent | b66e58d6c9cb1684bac548406f6a950bf0eb65e3 (diff) | |
parent | afa4e9f5754eff97904a3332ca23f0913d736688 (diff) | |
download | dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar.gz dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar.bz2 dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar.lz dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar.xz dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.tar.zst dexon-solidity-dc8fb45e1f1d098442458f14d80c343e4a445619.zip |
Merge remote-tracking branch 'ethereum/develop' into sol_optimizer
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 93cb172d..9ae8d7c6 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -272,7 +272,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; } @@ -285,8 +285,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; } |