diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-03-10 02:22:24 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-03-10 19:02:48 +0800 |
commit | 74a01826ee9587ef9413e2ec808fcd53564f0b9d (patch) | |
tree | ad0d4cb8d7996b0906d1d3230ab19f697a46ddaa /Compiler.cpp | |
parent | 9c82cbeddf1b03cc99660a867de8720d1d174b9c (diff) | |
download | dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar.gz dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar.bz2 dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar.lz dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar.xz dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.tar.zst dexon-solidity-74a01826ee9587ef9413e2ec808fcd53564f0b9d.zip |
added information about jump type for jump instructions
Conflicts:
libevmcore/Assembly.cpp
libsolidity/Compiler.cpp
Diffstat (limited to 'Compiler.cpp')
-rw-r--r-- | Compiler.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index 7ff846bd..46888683 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -177,7 +177,9 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract) { callDataUnpackerEntryPoints.insert(std::make_pair(it.first, m_context.newTag())); m_context << eth::dupInstruction(1) << u256(FixedHash<4>::Arith(it.first)) << eth::Instruction::EQ; - m_context.appendConditionalJumpTo(callDataUnpackerEntryPoints.at(it.first)); + auto assemblyItem = callDataUnpackerEntryPoints.at(it.first); + //assemblyItem.setJumpType(eth::AssemblyItem::JumpType::IntoFunction); + m_context.appendConditionalJumpTo(assemblyItem); } if (FunctionDefinition const* fallback = _contract.getFallbackFunction()) { @@ -197,7 +199,9 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract) m_context << callDataUnpackerEntryPoints.at(it.first); eth::AssemblyItem returnTag = m_context.pushNewTag(); appendCalldataUnpacker(functionType->getParameterTypes()); - m_context.appendJumpTo(m_context.getFunctionEntryLabel(functionType->getDeclaration())); + auto assemblyItem = m_context.getFunctionEntryLabel(functionType->getDeclaration()); + //assemblyItem.setJumpType(eth::AssemblyItem::JumpType::IntoFunction); + m_context.appendJumpTo(assemblyItem); m_context << returnTag; appendReturnValuePacker(functionType->getReturnParameterTypes()); } @@ -378,8 +382,9 @@ bool Compiler::visit(FunctionDefinition const& _function) m_context.removeVariable(*localVariable); m_context.adjustStackOffset(-(int)c_returnValuesSize); + if (!_function.isConstructor()) - m_context << eth::Instruction::JUMP; + m_context.appendJump(eth::AssemblyItem::JumpType::OutOfFunction); return false; } |