mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5883 from ethereum/fixInlineAssembly
Do not provide access to external assembly variables from within functions.
This commit is contained in:
commit
e22a9ea5cf
@ -336,9 +336,11 @@ void CompilerContext::appendInlineAssembly(
|
|||||||
identifierAccess.resolve = [&](
|
identifierAccess.resolve = [&](
|
||||||
yul::Identifier const& _identifier,
|
yul::Identifier const& _identifier,
|
||||||
yul::IdentifierContext,
|
yul::IdentifierContext,
|
||||||
bool
|
bool _insideFunction
|
||||||
)
|
) -> size_t
|
||||||
{
|
{
|
||||||
|
if (_insideFunction)
|
||||||
|
return size_t(-1);
|
||||||
auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name.str());
|
auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name.str());
|
||||||
return it == _localVariables.end() ? size_t(-1) : 1;
|
return it == _localVariables.end() ? size_t(-1) : 1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user