summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/WasmYAML.cpp
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
commitc5b472f4405dd1afde70f0033ec832099bede676 (patch)
tree9c5d0c3a13a12d06db12de9545fbd2cdc1824b33 /llvm/lib/ObjectYAML/WasmYAML.cpp
parent3f2b1d741e211dd1af9f53639824cdc7e57b29dc (diff)
downloadbcm5719-llvm-c5b472f4405dd1afde70f0033ec832099bede676.tar.gz
bcm5719-llvm-c5b472f4405dd1afde70f0033ec832099bede676.zip
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 llvm-svn: 299270
Diffstat (limited to 'llvm/lib/ObjectYAML/WasmYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/WasmYAML.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp
index b82637a741b..3e1bed19d61 100644
--- a/llvm/lib/ObjectYAML/WasmYAML.cpp
+++ b/llvm/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(
OpenPOWER on IntegriCloud