Refactor data flow analyzer state access.

This commit is contained in:
chriseth
2022-03-14 19:32:33 +01:00
parent e154d43176
commit eab4ca906c
14 changed files with 81 additions and 48 deletions
+2 -2
View File
@@ -80,8 +80,8 @@ bool KnowledgeBase::knownToBeZero(YulString _a)
optional<u256> KnowledgeBase::valueIfKnownConstant(YulString _a)
{
if (m_variableValues.count(_a))
if (Literal const* literal = get_if<Literal>(m_variableValues.at(_a).value))
if (AssignedValue const* value = m_variableValues(_a))
if (Literal const* literal = get_if<Literal>(value->value))
return valueOfLiteral(*literal);
return {};
}