mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IDE] Fix sort predicate in printCodeCompletionLookedupTypeNames
This wasn't a strict weak ordering, and it turns out violating that is undefined behavior which can result in buffer overruns.
This commit is contained in:
@@ -1379,7 +1379,7 @@ printCodeCompletionLookedupTypeNames(ArrayRef<NullTerminatedStringRef> names,
|
||||
sortedNames.append(names.begin(), names.end());
|
||||
llvm::sort(sortedNames,
|
||||
[](NullTerminatedStringRef a, NullTerminatedStringRef b) {
|
||||
return a.compare(b) <= 0;
|
||||
return a.compare(b) < 0;
|
||||
});
|
||||
|
||||
OS << "LookedupTypeNames: [";
|
||||
|
||||
Reference in New Issue
Block a user