aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/Compiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/Compiler.cpp')
-rw-r--r--libsolidity/Compiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp
index 7ce2121e..64a67a4f 100644
--- a/libsolidity/Compiler.cpp
+++ b/libsolidity/Compiler.cpp
@@ -623,10 +623,13 @@ bool Compiler::visit(VariableDeclarationStatement const& _variableDeclarationSta
{
StackHeightChecker checker(m_context);
CompilerContext::LocationSetter locationSetter(m_context, _variableDeclarationStatement);
- if (Expression const* expression = _variableDeclarationStatement.expression())
+ solAssert(_variableDeclarationStatement.declarations().size() == 1, "To be implemented.");
+ solAssert(!!_variableDeclarationStatement.declarations().front(), "");
+ VariableDeclaration const& varDecl = *_variableDeclarationStatement.declarations().front();
+ if (Expression const* expression = _variableDeclarationStatement.initialValue())
{
- compileExpression(*expression, _variableDeclarationStatement.declaration().annotation().type);
- CompilerUtils(m_context).moveToStackVariable(_variableDeclarationStatement.declaration());
+ compileExpression(*expression, varDecl.annotation().type);
+ CompilerUtils(m_context).moveToStackVariable(varDecl);
}
checker.check();
return false;