[Remarks] Fix mismatched delete due to missing virtual destructor
authorJordan Rupprecht <rupprecht@google.com>
Wed, 20 Mar 2019 17:44:24 +0000 (17:44 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Wed, 20 Mar 2019 17:44:24 +0000 (17:44 +0000)
This fixes an asan failure introduced in r356519.

llvm-svn: 356583

llvm/lib/Remarks/RemarkParserImpl.h

index 6804657..b4c106b 100644 (file)
@@ -19,6 +19,10 @@ namespace remarks {
 struct ParserImpl {
   enum class Kind { YAML };
 
+  explicit ParserImpl(Kind TheParserKind) : ParserKind(TheParserKind) {}
+  // Virtual destructor prevents mismatched deletes
+  virtual ~ParserImpl() {}
+
   // The parser kind. This is used as a tag to safely cast between
   // implementations.
   Kind ParserKind;