Don't use iterator addresses in IteratorComparator

The addresses of the iterator values are non-deterministic (i.e. they
depend on where the values were allocated). This causes stability issues
when fuzzing (e.g. in the `txorphan` and `mini_miner` harnesses), due
the orders (derived from IteratorComparator) not being deterministic.

Improve stability by comparing the first element in the iterator value
pair instead of using the the value addresses.
This commit is contained in:
dergoegge committed 2024-06-19 10:14:31 +01:00
1 parent 41544b8f96
commit e009bf681c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ struct IteratorComparator
template<typename I>
bool operator()(const I& a, const I& b) const
{
return &(*a) < &(*b);
return a->first < b->first;
}
};