Skip to content

Commit

Permalink
fix UB with (unused) uniform_int_distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Jan 20, 2025
1 parent 5f1c63f commit aca9c69
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/components/range_minimum_query_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ class RangeMinimumQuery : public CommonTestFixture {
{
std::vector<index_type> begins;
std::vector<index_type> ends;
std::uniform_int_distribution<index_type> dist{0, size - 1};
const auto add_query = [&](index_type begin, index_type end) {
assert(begin <= end);
assert(begin >= 0);
assert(end < size);
begins.push_back(begin);
ends.push_back(end);
};
if (size > 0) {
std::uniform_int_distribution<index_type> dist{0, size - 1};
const auto add_query = [&](index_type begin, index_type end) {
assert(begin <= end);
assert(begin >= 0);
assert(end < size);
begins.push_back(begin);
ends.push_back(end);
};
for (const auto i : gko::irange{size}) {
// singleton queries
add_query(i, i);
Expand Down

0 comments on commit aca9c69

Please sign in to comment.