aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
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;
}