mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Display actual error message and not assertion in analysis
This commit is contained in:
parent
cb4966046d
commit
3451a30e5c
@ -184,7 +184,15 @@ bool AsmAnalyzer::operator()(assembly::VariableDeclaration const& _varDecl)
|
|||||||
int const expectedItems = _varDecl.variables.size();
|
int const expectedItems = _varDecl.variables.size();
|
||||||
int const stackHeight = m_stackHeight;
|
int const stackHeight = m_stackHeight;
|
||||||
bool success = boost::apply_visitor(*this, *_varDecl.value);
|
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)
|
for (auto const& variable: _varDecl.variables)
|
||||||
boost::get<Scope::Variable>(m_currentScope->identifiers.at(variable.name)).active = true;
|
boost::get<Scope::Variable>(m_currentScope->identifiers.at(variable.name)).active = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user