Commit f74f3e6f authored by Tulio Magno Quites Machado Filho's avatar Tulio Magno Quites Machado Filho Committed by Tobias Hieta
Browse files

[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 cf1bde33)
parent 7e30ce95
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment