diff options
author | Tim Northover <tnorthover@apple.com> | 2014-06-25 15:12:55 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-06-25 15:12:55 +0000 |
commit | 1565e56785c84af6ae59f950f367a7963481456b (patch) | |
tree | 513d97e716a4988828e8948e39da3c9663e290e8 | |
parent | a9b7ec18f120e3570c5e41ce485cc12845c80d2b (diff) | |
download | bcm5719-llvm-1565e56785c84af6ae59f950f367a7963481456b.tar.gz bcm5719-llvm-1565e56785c84af6ae59f950f367a7963481456b.zip |
[mach-o]: make sure custom sort method is irreflexive.
The previous function returned true for "s < s", which could completely mess up
the sorting of symbols within a section.
Unfortunately, I don't think there's a robust way to write a test for this.
Anything I come up with will be making assumptions about the particular
implementation of std::sort.
llvm-svn: 211704
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 1a03ede80ac..a582c975799 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -272,8 +272,8 @@ std::error_code processSymboledSection(DefinedAtom::ContentType atomType, Atom::Scope rScope = atomScope(rhs->scope); if (lScope != rScope) return lScope < rScope; - // If same address and scope, sort by name. - return (lhs->name.compare(rhs->name) < 1); + // If same address and scope, sort by name. + return lhs->name < rhs->name; }); // Debug logging of symbols. |