diff options
Diffstat (limited to 'libsolidity/inlineasm/AsmCodeGen.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmCodeGen.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp index b8af9dc6..1063d552 100644 --- a/libsolidity/inlineasm/AsmCodeGen.cpp +++ b/libsolidity/inlineasm/AsmCodeGen.cpp @@ -251,11 +251,16 @@ public: void operator()(assembly::VariableDeclaration const& _varDecl) { int height = m_assembly.stackHeight(); - boost::apply_visitor(*this, *_varDecl.value); - expectDeposit(1, height); - auto& var = boost::get<Scope::Variable>(m_scope.identifiers.at(_varDecl.variable.name)); - var.stackHeight = height; - var.active = true; + int expectedItems = _varDecl.variables.size(); + for (auto const& value: _varDecl.values) + boost::apply_visitor(*this, value); + expectDeposit(expectedItems, height); + for (auto const& variable: _varDecl.variables) + { + auto& var = boost::get<Scope::Variable>(m_scope.identifiers.at(variable.name)); + var.stackHeight = height++; + var.active = true; + } } void operator()(assembly::Block const& _block) { |