OSDN Git Service

[PDB] One more fix for hasing GSI records.
authorZachary Turner <zturner@google.com>
Fri, 6 Jul 2018 21:01:42 +0000 (21:01 +0000)
committerZachary Turner <zturner@google.com>
Fri, 6 Jul 2018 21:01:42 +0000 (21:01 +0000)
commitc779b36d254d32d46f9fab6ec1ef16c5c58620ec
tree849d458d36cd057697d85a86d3e8380e45653c1b
parentc2801b164018b2c7d2e7a20a617e2953fbbdc07d
[PDB] One more fix for hasing GSI records.

The reference implementation uses a case-insensitive string
comparison for strings of equal length.  This will cause the
string "tEo" to compare less than "VUo".  However we were using
a case sensitive comparison, which would generate the opposite
outcome.  Switch to a case insensitive comparison.  Also, when
one of the strings contains non-ascii characters, fallback to
a straight memcmp.

The only way to really test this is with a DIA test.  Before this
patch, the test will fail (but succeed if link.exe is used instead
of lld-link).  After the patch, it succeeds even with lld-link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336464 91177308-0d34-0410-b5e6-96231b3b80d8
lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
tools/llvm-pdbutil/PrettyExternalSymbolDumper.cpp
tools/llvm-pdbutil/llvm-pdbutil.cpp
tools/llvm-pdbutil/llvm-pdbutil.h