llvm.org GIT mirror llvm / 449a88e
Plug a memory leak in a unit test. Stack allocation is sufficient here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191638 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 7 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1818 using namespace llvm;
1919 TEST(DIEHashData1Test, DIEHash) {
2020 DIEHash Hash;
21 DIE *Die = new DIE(dwarf::DW_TAG_base_type);
22 DIEValue *Size = new DIEInteger(4);
23 Die->addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, Size);
24 uint64_t MD5Res = Hash.computeTypeSignature(Die);
21 DIE Die(dwarf::DW_TAG_base_type);
22 DIEInteger Size(4);
23 Die.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Size);
24 uint64_t MD5Res = Hash.computeTypeSignature(&Die);
2525 ASSERT_TRUE(MD5Res == 0x540e9ff30ade3e4aULL);
26 delete Die;
2726 }
2827 }