diff options
author | Christian <c@ethdev.com> | 2014-11-25 21:43:23 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-26 22:35:25 +0800 |
commit | a2715c5f34cfa4050ba64b4a1467b9ca5821472b (patch) | |
tree | 699b649087db7c9b5c9eb000fb452d404af7c755 /ExpressionCompiler.cpp | |
parent | 6e6b85b58a478a7e2bc0f8bee976df97f9861b91 (diff) | |
download | dexon-solidity-a2715c5f34cfa4050ba64b4a1467b9ca5821472b.tar.gz dexon-solidity-a2715c5f34cfa4050ba64b4a1467b9ca5821472b.tar.zst dexon-solidity-a2715c5f34cfa4050ba64b4a1467b9ca5821472b.zip |
More general function types and references.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index de8bc1d2..9e396874 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -183,16 +183,16 @@ bool ExpressionCompiler::visit(FunctionCall& _functionCall) // Calling convention: Caller pushes return address and arguments // Callee removes them and pushes return values - FunctionDefinition const& function = dynamic_cast<FunctionType const&>(*_functionCall.getExpression().getType()).getFunction(); + FunctionType const& function = dynamic_cast<FunctionType const&>(*_functionCall.getExpression().getType()); eth::AssemblyItem returnLabel = m_context.pushNewTag(); std::vector<ASTPointer<Expression>> const& arguments = _functionCall.getArguments(); - if (asserts(arguments.size() == function.getParameters().size())) + if (asserts(arguments.size() == function.getParameterTypes().size())) BOOST_THROW_EXCEPTION(InternalCompilerError()); for (unsigned i = 0; i < arguments.size(); ++i) { arguments[i]->accept(*this); - appendTypeConversion(*arguments[i]->getType(), *function.getParameters()[i]->getType()); + appendTypeConversion(*arguments[i]->getType(), *function.getParameterTypes()[i]); } _functionCall.getExpression().accept(*this); @@ -200,11 +200,11 @@ bool ExpressionCompiler::visit(FunctionCall& _functionCall) m_context << returnLabel; // callee adds return parameters, but removes arguments and return label - m_context.adjustStackOffset(function.getReturnParameters().size() - arguments.size() - 1); + m_context.adjustStackOffset(function.getReturnParameterTypes().size() - arguments.size() - 1); // @todo for now, the return value of a function is its first return value, so remove // all others - for (unsigned i = 1; i < function.getReturnParameters().size(); ++i) + for (unsigned i = 1; i < function.getReturnParameterTypes().size(); ++i) m_context << eth::Instruction::POP; } return false; |