summaryrefslogtreecommitdiff
path: root/lib/ObjectYAML
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2017-03-31 22:14:14 +0000
committerDerek Schuff <dschuff@google.com>2017-03-31 22:14:14 +0000
commit9120fd790435c128c5c7b510fbfd23c802eaff87 (patch)
tree0e81642ce064217cfdb3076af9e9c16ac910aae4 /lib/ObjectYAML
parent7afeaaf4b7a91fd7dc0b4a64bf9b9d4869007932 (diff)
Add virtual destructor to WasmYAML::Section or avoid memory leak
Tested locally with -DLLVM_USE_SANITIZER=Address Differential Revision: https://reviews.llvm.org/D31551 Patch by Sam Clegg git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r--lib/ObjectYAML/WasmYAML.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ObjectYAML/WasmYAML.cpp b/lib/ObjectYAML/WasmYAML.cpp
index b82637a741b..3e1bed19d61 100644
--- a/lib/ObjectYAML/WasmYAML.cpp
+++ b/lib/ObjectYAML/WasmYAML.cpp
@@ -17,6 +17,15 @@
#include "llvm/Support/MipsABIFlags.h"
namespace llvm {
+
+namespace WasmYAML {
+
+// Declared here rather than in the header to comply with:
+// http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers
+Section::~Section() {}
+
+} // end namespace WasmYAML
+
namespace yaml {
void MappingTraits<WasmYAML::FileHeader>::mapping(