summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-04-23 11:10:55 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-04-23 11:10:55 +0000
commit62fce0a975fe5e64154a6c9d388fc46133d68ddc (patch)
tree6f74ad6205eabc25ddad82b855a53af6aebac389 /llvm
parent9302fbf0aeed1af6bc91cefd6b65c3a268d1fb9e (diff)
downloadbcm5719-llvm-62fce0a975fe5e64154a6c9d388fc46133d68ddc.tar.gz
bcm5719-llvm-62fce0a975fe5e64154a6c9d388fc46133d68ddc.zip
[yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class
to prevent memory leaks. llvm-svn: 206969
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Object/ELFYAML.h1
-rw-r--r--llvm/lib/Object/ELFYAML.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/Object/ELFYAML.h b/llvm/include/llvm/Object/ELFYAML.h
index 38707776abe..26bfaaed6da 100644
--- a/llvm/include/llvm/Object/ELFYAML.h
+++ b/llvm/include/llvm/Object/ELFYAML.h
@@ -79,6 +79,7 @@ struct Section {
StringRef Info;
llvm::yaml::Hex64 AddressAlign;
Section(SectionKind Kind) : Kind(Kind) {}
+ virtual ~Section();
};
struct RawContentSection : Section {
object::yaml::BinaryRef Content;
diff --git a/llvm/lib/Object/ELFYAML.cpp b/llvm/lib/Object/ELFYAML.cpp
index 59d9c06f370..f7ba237883a 100644
--- a/llvm/lib/Object/ELFYAML.cpp
+++ b/llvm/lib/Object/ELFYAML.cpp
@@ -14,6 +14,9 @@
#include "llvm/Object/ELFYAML.h"
namespace llvm {
+
+ELFYAML::Section ::~Section() {}
+
namespace yaml {
void
OpenPOWER on IntegriCloud