Merge pull request #4724 from ethereum/slot-in-assembly

Do not crash on using _slot and _offset suffixes on their own
This commit is contained in:
Alex Beregszaszi
2018-08-07 12:55:40 +01:00
committed by GitHub
4 changed files with 24 additions and 0 deletions
@@ -256,6 +256,11 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
string("_slot").size() :
string("_offset").size()
));
if (realName.empty())
{
declarationError(_identifier.location, "In variable names _slot and _offset can only be used as a suffix.");
return size_t(-1);
}
declarations = m_resolver.nameFromCurrentScope(realName);
}
if (declarations.size() != 1)