diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-06 04:10:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-23 01:45:34 +0800 |
commit | 3451a30e5cd6d8bceedba70bf9c5012f263b3ec8 (patch) | |
tree | 0347a071be6b683764bd4d7562898a998eec034f | |
parent | cb4966046d9871b63084ddcf0ff6fac8a4c322aa (diff) | |
download | dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar.gz dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar.bz2 dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar.lz dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar.xz dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.tar.zst dexon-solidity-3451a30e5cd6d8bceedba70bf9c5012f263b3ec8.zip |
Display actual error message and not assertion in analysis
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 5062fcf4..9e0ade2a 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -184,7 +184,15 @@ bool AsmAnalyzer::operator()(assembly::VariableDeclaration const& _varDecl) int const expectedItems = _varDecl.variables.size(); int const stackHeight = m_stackHeight; bool success = boost::apply_visitor(*this, *_varDecl.value); - solAssert(m_stackHeight - stackHeight == expectedItems, "Invalid value size."); + if ((m_stackHeight - stackHeight) != expectedItems) + { + m_errors.push_back(make_shared<Error>( + Error::Type::DeclarationError, + "Variable count mismatch.", + _varDecl.location + )); + return false; + } for (auto const& variable: _varDecl.variables) boost::get<Scope::Variable>(m_currentScope->identifiers.at(variable.name)).active = true; |