llvm-project
2265d324 - [pdb] Fix libc++ strict-weak-ordering assertion failures from gsiRecordCmp (#183749)

Commit
8 days ago
[pdb] Fix libc++ strict-weak-ordering assertion failures from gsiRecordCmp (#183749) Builds using libc++ hardening was hitting asserts like libc++ Hardening assertion !__comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering printf-debugging revealed that symbols like "?ST@@3JA" were not comparing equal with themselves. It turns out the comparison was done with return S1.compare_insensitive(S2.data()); and even when &S1 == &S2, S1 and S2.data() may not refer to identical strings, since data() may not have a null terminator where the StringRef locally ends. This fixes the ordering, simplifies the code, and makes it a little faster :) Fixes: #163755
Author
Parents
Loading