[BOLT][DWARF] Fix size mismatch error with jemalloc

Summary:
When building with GCC and linking against jemalloc there is an
assertion when Debug Patches unique pointers are being freed from an std vector.
The base destructor gets invoked which results in type mismatch.
Added virtual destructor to the base class.

(cherry picked from FBD33489259)
This commit is contained in:
Alexander Yermolovich
2022-01-07 18:25:54 -08:00
committed by Maksim Panchenko
parent 330c8e42ab
commit 4243b6582c

View File

@@ -498,6 +498,8 @@ public:
Patch(uint32_t O, DebugPatchKind K) : Offset(O), Kind(K) {}
DebugPatchKind getKind() const { return Kind; }
virtual ~Patch(){};
static bool classof(const Patch *Writer) {
return Writer->getKind() == DebugPatchKind::PatchBaseClass;
}