aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-08 23:56:41 +0800
committerChristian <c@ethdev.com>2014-12-08 23:56:41 +0800
commitcd5f4958613ab131980c4b15563ad9d0017d8d5c (patch)
tree7e9f4ef84501756e20a042ffd3a24b9802735ead /Compiler.cpp
parent57e6827cb57708ed8f687bf9b0a304b1481cf742 (diff)
downloaddexon-solidity-cd5f4958613ab131980c4b15563ad9d0017d8d5c.tar.gz
dexon-solidity-cd5f4958613ab131980c4b15563ad9d0017d8d5c.tar.zst
dexon-solidity-cd5f4958613ab131980c4b15563ad9d0017d8d5c.zip
Register variably-sized variables on stack.
Diffstat (limited to 'Compiler.cpp')
-rw-r--r--Compiler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Compiler.cpp b/Compiler.cpp
index 17ad4fd1..66d938d1 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -199,11 +199,12 @@ bool Compiler::visit(FunctionDefinition& _function)
unsigned const numReturnValues = _function.getReturnParameters().size();
unsigned const numLocalVariables = _function.getLocalVariables().size();
- for (ASTPointer<VariableDeclaration> const& variable: _function.getParameters() + _function.getReturnParameters())
+ for (ASTPointer<VariableDeclaration> const& variable: _function.getParameters())
m_context.addVariable(*variable);
+ for (ASTPointer<VariableDeclaration> const& variable: _function.getReturnParameters())
+ m_context.addAndInitializeVariable(*variable);
for (VariableDeclaration const* localVariable: _function.getLocalVariables())
- m_context.addVariable(*localVariable);
- m_context.initializeLocalVariables(numReturnValues + numLocalVariables);
+ m_context.addAndInitializeVariable(*localVariable);
_function.getBody().accept(*this);