aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-27 23:55:06 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-29 04:46:16 +0800
commit2947e038d28d3d732b1db352f71c8c9669df8eef (patch)
treed7ce1854e21c124b8af1ebcc300e04bda39890e1 /Compiler.cpp
parentff91ab96ea843bd8ab9a7c57fd799add2ebc9873 (diff)
downloaddexon-solidity-2947e038d28d3d732b1db352f71c8c9669df8eef.tar.gz
dexon-solidity-2947e038d28d3d732b1db352f71c8c9669df8eef.tar.zst
dexon-solidity-2947e038d28d3d732b1db352f71c8c9669df8eef.zip
EVM Code for simple accessor function is properly generated
Diffstat (limited to 'Compiler.cpp')
-rw-r--r--Compiler.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index c419f484..bda18bc6 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -292,21 +292,19 @@ void Compiler::registerStateVariables(ContractDefinition const& _contract)
m_context.addStateVariable(*variable);
}
-bool Compiler::generateAccessorCode(VariableDeclaration const& _varDecl)
+void Compiler::generateAccessorCode(VariableDeclaration const& _varDecl)
{
m_context.startNewFunction();
m_returnTag = m_context.newTag();
m_breakTags.clear();
m_continueTags.clear();
- // TODO: Work in progress
m_context << m_context.getFunctionEntryLabel(_varDecl);
- // CompilerUtils(m_context).moveToStackVariable(firstVariable);
- m_context.appendJumpTo(m_returnTag);
- m_context << m_returnTag;
+ ExpressionCompiler::appendStateVariableAccessor(m_context, &_varDecl);
- // TODO: perhaps return void if there are no checks?
- return true;
+ uint64_t foo = uint64_t(_varDecl.getType()->getStorageSize());
+ m_context << eth::dupInstruction(foo + 1);
+ m_context << eth::Instruction::JUMP;
}
bool Compiler::visit(FunctionDefinition const& _function)