Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Fix sorting module headers (#73146)
Struct Module::Header is not a POD type. As such, qsort() and llvm::array_pod_sort() must not be used to sort it. This became an issue with the new implementation of qsort() in glibc 2.39 that is not guaranteed to be a stable sort, causing Headers to be re-ordered and corrupted. Replace the usage of llvm::array_pod_sort() with std::stable_sort() in order to fix this issue. The signature of compareModuleHeaders() has to be modified. Fixes #73145. (cherry picked from commit cf1bde33423da5eb9b7dc95daac4aada3167de3c)
- Loading branch information