summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-12-08 16:57:04 +0000
committerGreg Clayton <gclayton@apple.com>2016-12-08 16:57:04 +0000
commitb90328356a50f219af9d355943f7e1149bab22f2 (patch)
tree29af9b56ae39a82a50895ee11dd69aa68728c527 /llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
parent4737f941323c33305cc02ead13efc7e23ceadef1 (diff)
downloadbcm5719-llvm-b90328356a50f219af9d355943f7e1149bab22f2.tar.gz
bcm5719-llvm-b90328356a50f219af9d355943f7e1149bab22f2.zip
Fix ASAN buildbots by fixing a double free crash.
The dwarfgen::Generator::StringPool was in a unique_ptr but it was owned by the Allocator member variable so it was being free twice. llvm-svn: 289070
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index 06fa121e7a2..05039875729 100644
--- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -110,7 +110,9 @@ dwarfgen::DIE dwarfgen::CompileUnit::getUnitDIE() {
/// dwarfgen::Generator implementation.
//===----------------------------------------------------------------------===//
-dwarfgen::Generator::Generator() : Abbreviations(Allocator) {}
+dwarfgen::Generator::Generator()
+ : MAB(nullptr), MCE(nullptr), MS(nullptr), StringPool(nullptr),
+ Abbreviations(Allocator) {}
dwarfgen::Generator::~Generator() = default;
llvm::Expected<std::unique_ptr<dwarfgen::Generator>>
@@ -201,7 +203,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
MC->setDwarfVersion(Version);
Asm->setDwarfVersion(Version);
- StringPool.reset(new DwarfStringPool(Allocator, *Asm, StringRef()));
+ StringPool = new DwarfStringPool(Allocator, *Asm, StringRef());
return Error::success();
}
OpenPOWER on IntegriCloud