YulOpt: Extend StructuralSimplifier to work with all types

This commit is contained in:
Mathias Baumann
2019-03-05 18:39:27 +01:00
parent a52b50d770
commit f6e09d6368
2 changed files with 14 additions and 2 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ boost::optional<dev::u256> StructuralSimplifier::hasLiteralValue(Expression cons
if (expr && expr->type() == typeid(Literal))
{
Literal const& literal = boost::get<Literal>(*expr);
return valueOfNumberLiteral(literal);
return valueOfLiteral(literal);
}
return boost::optional<u256>();
@@ -114,7 +114,7 @@ void StructuralSimplifier::simplify(std::vector<yul::Statement>& _statements)
for (auto& _case: _switchStmt.cases)
{
if (_case.value && valueOfNumberLiteral(*_case.value) == constExprVal)
if (_case.value && valueOfLiteral(*_case.value) == constExprVal)
{
matchingCaseBlock = &_case.body;
break;