aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-03-10 02:22:24 +0800
committerLiana Husikyan <liana@ethdev.com>2015-03-10 19:02:48 +0800
commit74a01826ee9587ef9413e2ec808fcd53564f0b9d (patch)
treead0d4cb8d7996b0906d1d3230ab19f697a46ddaa /Compiler.cpp
parent9c82cbeddf1b03cc99660a867de8720d1d174b9c (diff)
downloaddexon-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.cpp11
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;
}