Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4095,6 +4095,12 @@ static void sortMapIndices(llvm::SmallVectorImpl<size_t> &indices,
llvm::SmallVector<size_t> occludedChildren;
llvm::sort(
indices.begin(), indices.end(), [&](const size_t a, const size_t b) {
// Bail early if we are asked to look at the same index. If we do not
// bail early, we can end up mistakenly adding indices to
// occludedChildren. This can occur with some types of libc++ hardening.
if (a == b)
return false;

auto memberIndicesA = cast<ArrayAttr>(indexAttr[a]);
auto memberIndicesB = cast<ArrayAttr>(indexAttr[b]);

Expand Down