diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-10-16 20:29:06 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-10-16 20:29:06 +0000 |
commit | 71a0ad66a95953ed0ad9da7e4502f9f43b2149a0 (patch) | |
tree | 9f5653bba7b2ce5c8b4d3fec972fd50950e78c56 /llvm | |
parent | 1a7cf8c23a59b65958ab4a2d95bfd46ed4a1999c (diff) | |
download | bcm5719-llvm-71a0ad66a95953ed0ad9da7e4502f9f43b2149a0.tar.gz bcm5719-llvm-71a0ad66a95953ed0ad9da7e4502f9f43b2149a0.zip |
DIEHash: Include the trailing zero byte after the children of a DIE
llvm-svn: 192836
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp | 3 | ||||
-rw-r--r-- | llvm/unittests/CodeGen/DIEHashTest.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp index c56d2e64730..abc504c0581 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp @@ -383,6 +383,9 @@ void DIEHash::computeHash(DIE *Die) { E = Die->getChildren().end(); I != E; ++I) computeHash(*I); + + // Following the last (or if there are no children), append a zero byte. + Hash.update((uint8_t)0); } /// This is based on the type signature computation given in section 7.27 of the diff --git a/llvm/unittests/CodeGen/DIEHashTest.cpp b/llvm/unittests/CodeGen/DIEHashTest.cpp index 6b9a4dbc26a..86358d5d31a 100644 --- a/llvm/unittests/CodeGen/DIEHashTest.cpp +++ b/llvm/unittests/CodeGen/DIEHashTest.cpp @@ -23,6 +23,6 @@ TEST(DIEHashData1Test, DIEHash) { DIEInteger Size(4); Die.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Size); uint64_t MD5Res = Hash.computeTypeSignature(&Die); - ASSERT_EQ(MD5Res, 0x540e9ff30ade3e4aULL); + ASSERT_EQ(MD5Res, 0x4F68EF1039F8D2BULL); } } |