mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Also apply simplification rules that require multiple identical sub-expressions.
This commit is contained in:
1 parent
f7392cc698
commit
5523296eaa
5 files changed
+163
-3
No files matched your search
@@ -40,6 +40,7 @@ void ExpressionSimplifier::visit(Expression& _expression)
|
||||
ASTModifier::visit(_expression);
|
||||
while (auto match = SimplificationRules::findFirstMatch(_expression))
|
||||
{
|
||||
// Do not apply the rule if it removes non-constant parts of the expression.
|
||||
// TODO: The check could actually be less strict than "movable".
|
||||
// We only require "Does not cause side-effects".
|
||||
if (std::get<2>(*match) && !MovableChecker(_expression).movable())
|
||||
|
||||
Reference in new issue
Block a user