From 04f5eb407c74d433589739a719c3fc75a08859b3 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 23 Jul 2021 16:54:19 -0400 Subject: [PATCH] [lld/mac] Fix start-stop.s test with expensive checks enabled See e.g. https://lab.llvm.org/buildbot/#/builders/16/builds/14317 Not 100% sure why this fails yet, but this fixes it. Let's get the bots green again first :) Differential Revision: https://reviews.llvm.org/D106711 --- lld/MachO/OutputSegment.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp index 8a050c4..7345bf0 100644 --- a/lld/MachO/OutputSegment.cpp +++ b/lld/MachO/OutputSegment.cpp @@ -146,10 +146,8 @@ void OutputSegment::sortOutputSections() { } void macho::sortOutputSegments() { - // sort() instead of stable_sort() is fine because segmentOrder() is - // name-based and getOrCreateOutputSegment() makes there's only a single - // segment for every name. - llvm::sort(outputSegments, compareByOrder(segmentOrder)); + llvm::stable_sort(outputSegments, + compareByOrder(segmentOrder)); } static DenseMap nameToOutputSegment; -- 2.7.4