summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-05-17 20:47:22 +0000
committerReid Kleckner <rnk@google.com>2018-05-17 20:47:22 +0000
commitf40f85868e690eefc3bb65f030e5f7890d349794 (patch)
treebb04d9404c9065f113511b0ff14b273595c3e2e8 /llvm/lib/DebugInfo/CodeView
parent0d8fa1b6fda2acf85f01ec550781ccd70a547967 (diff)
downloadbcm5719-llvm-f40f85868e690eefc3bb65f030e5f7890d349794.tar.gz
bcm5719-llvm-f40f85868e690eefc3bb65f030e5f7890d349794.zip
[codeview] Include record prefix in global type hashing
The prefix includes type kind, which is important to preserve. Two different type leafs can easily have the same interior record contents as another type. We ran into this issue in PR37492 where a bitfield type record collided with a const modifier record. Their contents were bitwise identical, but their kinds were different. llvm-svn: 332664
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeHashing.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp b/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp
index f5b28b2a207..c2f8cd5466a 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeHashing.cpp
@@ -39,6 +39,7 @@ GloballyHashedType::hashType(ArrayRef<uint8_t> RecordData,
SHA1 S;
S.init();
uint32_t Off = 0;
+ S.update(RecordData.take_front(sizeof(RecordPrefix)));
RecordData = RecordData.drop_front(sizeof(RecordPrefix));
for (const auto &Ref : Refs) {
// Hash any data that comes before this TiRef.
OpenPOWER on IntegriCloud