Skip to content

Commit 78acca1

Browse files
r0qsclonker
authored andcommitted
Fix sign conversion warnings when comparing/assigning signed and unsigned integers
1 parent 34723b7 commit 78acca1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libyul/backends/evm/ssa/OperationForwardShuffler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ class OperationForwardShuffler
164164

165165
size_t targetMinCount(Slot const& _slot) const
166166
{
167-
return util::valueOrDefault(targetMinCounts, _slot, 0);
167+
return util::valueOrDefault(targetMinCounts, _slot, size_t{0});
168168
}
169169

170170
size_t targetArgsCount(Slot const& _slot) const
171171
{
172-
return ranges::count_if(args, [&](auto const& _arg) { return _arg == _slot; });
172+
return static_cast<size_t>(ranges::count_if(args, [&](auto const& _arg) { return _arg == _slot; }));
173173
}
174174

175175
bool stackAdmissible() const

libyul/backends/evm/ssa/StackLayoutGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void StackLayoutGenerator::defineStackIn(SSACFG::BlockId const& _blockId)
318318
}
319319
cumulativeCosts[i] = cumulativeCost;
320320
}
321-
auto argMin = std::distance(cumulativeCosts.begin(), ranges::min_element(cumulativeCosts));
321+
auto argMin = static_cast<size_t>(std::distance(cumulativeCosts.begin(), ranges::min_element(cumulativeCosts)));
322322
yulAssert(parentExits[argMin].second);
323323
// fmt::print(">> ARGMIN: {} (out of {})\n", argMin, cumulativeCosts.size());
324324
m_stackLayout[_blockId].stackIn = *parentExits[argMin].second;

0 commit comments

Comments
 (0)