diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-06 01:56:29 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-23 01:45:34 +0800 |
commit | cb4966046d9871b63084ddcf0ff6fac8a4c322aa (patch) | |
tree | 3fde5c5114865b10c30c71b8a2327a476868d041 /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | 15b4d4def23bcf0feb93c67dccc137baa59d5102 (diff) | |
download | dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar.gz dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar.bz2 dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar.lz dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar.xz dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.tar.zst dexon-solidity-cb4966046d9871b63084ddcf0ff6fac8a4c322aa.zip |
Enable a single right hand item on let
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 8d3d1fd2..5062fcf4 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -181,32 +181,15 @@ bool AsmAnalyzer::operator()(FunctionalAssignment const& _assignment) bool AsmAnalyzer::operator()(assembly::VariableDeclaration const& _varDecl) { - // The number of variable names and values must match. One exception - // is a single value, where a tuple assignment is assumed from a function. - if (_varDecl.variables.size() != _varDecl.values.size()) - { - if (_varDecl.values.size() != 1) - { - m_errors.push_back(make_shared<Error>( - Error::Type::DeclarationError, - "Variable declaration name and value count mismatch.", - _varDecl.location - )); - return false; - } - } - int const expectedItems = _varDecl.variables.size(); int const stackHeight = m_stackHeight; - for (auto const& value: _varDecl.values) - if (!boost::apply_visitor(*this, value)) - return false; + bool success = boost::apply_visitor(*this, *_varDecl.value); solAssert(m_stackHeight - stackHeight == expectedItems, "Invalid value size."); for (auto const& variable: _varDecl.variables) boost::get<Scope::Variable>(m_currentScope->identifiers.at(variable.name)).active = true; m_info.stackHeightInfo[&_varDecl] = m_stackHeight; - return true; + return success; } bool AsmAnalyzer::operator()(assembly::FunctionDefinition const& _funDef) |