Skip to content

Commit 84628d9

Browse files
authored
fix UBSAN failure (#24)
Signed-off-by: Lizan Zhou <[email protected]>
1 parent 04bc993 commit 84628d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_common.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ bool RunTestForInputPartitions(size_t chunk_count,
163163
// To choose a m-partition of input of size n, we need to choose m-1 breakdown
164164
// points between 1 and n-1.
165165
return ForSomeDistinctTuples(
166-
chunk_count - 1, input.size() - 1, partitioning_coefficient,
167-
[&input, test](const Tuple& t) {
166+
chunk_count - 1, input.empty() ? 0 : input.size() - 1,
167+
partitioning_coefficient, [&input, test](const Tuple& t) {
168168
if (!test(t)) {
169169
ADD_FAILURE() << "Failed for the following partition \""
170170
<< PartitionToDisplayString(input, t) << "\"\n";

0 commit comments

Comments
 (0)