[Lldb-commits] [lldb] [lldb] Fix iterator invalidation in SigchldHandler (PR #219752)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 3 02:52:10 PDT 2026


labath wrote:

Okay, I see what's happening. The libstdc++ implementaiton of any_of boils down to something like `{ return __last == _GLIBCXX_STD_A::find_if(__first, __last, __pred); }`, which means there's always an iterator comparison at the end. libc++ implements it via a loop, which means it bails out as soon as the predicate returns true (no iterator comparisons).

The libstdc++ behavior is a bit unfortunate, but they are probably within their rights to do it this way (I don't want to dive into the standard right now to confirm that). 

LGTM, just add a short sentence about why we're making the local copy.

https://github.com/llvm/llvm-project/pull/219752


More information about the lldb-commits mailing list