diff options
author | Gav Wood <i@gavwood.com> | 2015-01-09 22:19:01 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-01-09 22:19:01 +0800 |
commit | 43d79cc7305524bb8503e660cfd43c121706e1ed (patch) | |
tree | f25900a00a0a1b20998ec91d5da9730b3b78deab /ExpressionCompiler.cpp | |
parent | 875ec9d47178637bc8608204a8520c1487c064e4 (diff) | |
parent | a60d82d12ce84c87ae28e16dcd5002643f49637b (diff) | |
download | dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar.gz dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar.bz2 dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar.lz dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar.xz dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.tar.zst dexon-solidity-43d79cc7305524bb8503e660cfd43c121706e1ed.zip |
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
Conflicts:
test/SolidityOptimizer.cpp
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 8e8f492e..cf91a763 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -401,7 +401,7 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) case Type::Category::CONTRACT: { ContractType const& type = dynamic_cast<ContractType const&>(*_memberAccess.getExpression().getType()); - m_context << type.getFunctionIndex(member); + m_context << type.getFunctionIdentifier(member); break; } case Type::Category::MAGIC: @@ -663,7 +663,11 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio { solAssert(_arguments.size() == _functionType.getParameterTypes().size(), ""); - unsigned dataOffset = _options.bare ? 0 : 1; // reserve one byte for the function index + _options.obtainAddress(); + if (!_options.bare) + CompilerUtils(m_context).storeInMemory(0, CompilerUtils::dataStartOffset); + + unsigned dataOffset = _options.bare ? 0 : CompilerUtils::dataStartOffset; // reserve 4 bytes for the function's hash identifier for (unsigned i = 0; i < _arguments.size(); ++i) { _arguments[i]->accept(*this); @@ -690,12 +694,13 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio _options.obtainValue(); else m_context << u256(0); - _options.obtainAddress(); - if (!_options.bare) - m_context << u256(0) << eth::Instruction::MSTORE8; + m_context << eth::dupInstruction(6); //copy contract address + m_context << u256(25) << eth::Instruction::GAS << eth::Instruction::SUB << eth::Instruction::CALL - << eth::Instruction::POP; // @todo do not ignore failure indicator + << eth::Instruction::POP // @todo do not ignore failure indicator + << eth::Instruction::POP; // pop contract address + if (retSize > 0) { bool const leftAligned = firstType->getCategory() == Type::Category::STRING; |