Do not provide access to external assembly variables from within functions.

This commit is contained in:
chriseth 2019-01-28 14:41:33 +01:00
parent 0ef45b2890
commit 64312584dc

View File

@ -336,9 +336,11 @@ void CompilerContext::appendInlineAssembly(
identifierAccess.resolve = [&](
yul::Identifier const& _identifier,
yul::IdentifierContext,
bool
)
bool _insideFunction
) -> size_t
{
if (_insideFunction)
return size_t(-1);
auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name.str());
return it == _localVariables.end() ? size_t(-1) : 1;
};