diff --git a/libyul/backends/evm/ssa/StackShuffler.h b/libyul/backends/evm/ssa/StackShuffler.h index 70c381a899dc..974fd2386ae5 100644 --- a/libyul/backends/evm/ssa/StackShuffler.h +++ b/libyul/backends/evm/ssa/StackShuffler.h @@ -23,6 +23,7 @@ #include +#include #include #include #include @@ -161,9 +162,9 @@ class StackShuffler // check that all required values are on stack detail::State const state(_stack.data(), target, ReachableStackDepth); for (auto const& liveVariable: _liveOut | ranges::views::keys | ranges::views::transform(Slot::makeValueID)) - yulAssert(_stack.canBeFreelyGenerated(liveVariable) || ranges::find(_stack.data(), liveVariable) != ranges::end(_stack.data())); + yulAssert(!_stack.canBeFreelyGenerated(liveVariable) && ranges::contains(_stack.data(), liveVariable)); for (auto const& arg: _args) - yulAssert(_stack.canBeFreelyGenerated(arg) || ranges::find(_stack.data(), arg) != ranges::end(_stack.data())); + yulAssert(_stack.canBeFreelyGenerated(arg) || ranges::contains(_stack.data(), arg)); } static std::size_t constexpr maxIterations = 1000;