[llvm] r206969 - [yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class
Simon Atanasyan
simon at atanasyan.com
Wed Apr 23 04:10:56 PDT 2014
Author: atanasyan
Date: Wed Apr 23 06:10:55 2014
New Revision: 206969
URL: http://llvm.org/viewvc/llvm-project?rev=206969&view=rev
Log:
[yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class
to prevent memory leaks.
Modified:
llvm/trunk/include/llvm/Object/ELFYAML.h
llvm/trunk/lib/Object/ELFYAML.cpp
Modified: llvm/trunk/include/llvm/Object/ELFYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFYAML.h?rev=206969&r1=206968&r2=206969&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFYAML.h (original)
+++ llvm/trunk/include/llvm/Object/ELFYAML.h Wed Apr 23 06:10:55 2014
@@ -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;
Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=206969&r1=206968&r2=206969&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Wed Apr 23 06:10:55 2014
@@ -14,6 +14,9 @@
#include "llvm/Object/ELFYAML.h"
namespace llvm {
+
+ELFYAML::Section ::~Section() {}
+
namespace yaml {
void
More information about the llvm-commits
mailing list