Commit f74f3e6
[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 cf1bde3)1 parent 7e30ce9 commit f74f3e6
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2481 | 2481 | | |
2482 | 2482 | | |
2483 | 2483 | | |
2484 | | - | |
2485 | | - | |
2486 | | - | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
2487 | 2487 | | |
2488 | 2488 | | |
2489 | 2489 | | |
| |||
2546 | 2546 | | |
2547 | 2547 | | |
2548 | 2548 | | |
2549 | | - | |
| 2549 | + | |
2550 | 2550 | | |
2551 | 2551 | | |
2552 | 2552 | | |
| |||
0 commit comments