|
In GeoSearch::expandEndPoints there is an iterator decrement that can synthesize an iterator equivalent to --multiset::begin():
https://github.com/mongodb/mongo/blob/18de1d56412bfb89a6b3f95b18eeb770184fda15/src/mongo/db/geo/2d.cpp#L1823
This is illegal in C+11 even if the iterator is never dereferenced since one of the prerequisites for operator--() on a BidirectionalIterator 'r' is that there exists 's' such that r == ++s, and there is no such 's' for r == begin() [24.2.6]. This causes a crash when mongo is built against libc+.
Need to check C++98 to know for sure that this is illegal there (I'd guess it is), but it seems safer to not form the potentially illegal iterator anyway.
|