diff --git a/libyul/optimiser/CommonSubexpressionEliminator.cpp b/libyul/optimiser/CommonSubexpressionEliminator.cpp index 2f80e7bc4..6a739618c 100644 --- a/libyul/optimiser/CommonSubexpressionEliminator.cpp +++ b/libyul/optimiser/CommonSubexpressionEliminator.cpp @@ -103,9 +103,9 @@ void CommonSubexpressionEliminator::visit(Expression& _e) for (auto const& [variable, value]: m_value) { assertThrow(value.value, OptimizerException, ""); - assertThrow(inScope(variable), OptimizerException, ""); if (SyntacticallyEqual{}(_e, *value.value)) { + assertThrow(inScope(variable), OptimizerException, ""); _e = Identifier{locationOf(_e), variable}; break; }