mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactor data flow analyzer state access.
This commit is contained in:
@@ -82,12 +82,12 @@ void LoadResolver::tryResolve(
|
||||
YulString key = std::get<Identifier>(_arguments.at(0)).name;
|
||||
if (_location == StoreLoadLocation::Storage)
|
||||
{
|
||||
if (auto value = util::valueOrNullptr(m_storage, key))
|
||||
if (auto value = storageValue(key))
|
||||
if (inScope(*value))
|
||||
_e = Identifier{debugDataOf(_e), *value};
|
||||
}
|
||||
else if (!m_containsMSize && _location == StoreLoadLocation::Memory)
|
||||
if (auto value = util::valueOrNullptr(m_memory, key))
|
||||
if (auto value = memoryValue(key))
|
||||
if (inScope(*value))
|
||||
_e = Identifier{debugDataOf(_e), *value};
|
||||
}
|
||||
@@ -129,10 +129,10 @@ void LoadResolver::tryEvaluateKeccak(
|
||||
if (costOfLiteral > costOfKeccak)
|
||||
return;
|
||||
|
||||
auto memoryValue = util::valueOrNullptr(m_memory, memoryKey->name);
|
||||
if (memoryValue && inScope(*memoryValue))
|
||||
optional<YulString> value = memoryValue(memoryKey->name);
|
||||
if (value && inScope(*value))
|
||||
{
|
||||
optional<u256> memoryContent = valueOfIdentifier(*memoryValue);
|
||||
optional<u256> memoryContent = valueOfIdentifier(*value);
|
||||
optional<u256> byteLength = valueOfIdentifier(length->name);
|
||||
if (memoryContent && byteLength && *byteLength <= 32)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user