base, sim: Add missing destructors
Derived classes with virtual functions need to define a virtual destructor or a protected destructor otherwise calling the base class destructor has undefined behavior. This change adds a virtual distructor in the base class. Change-Id: I1c855aa56dff6585ff99b9147bdb4eb9729a0a53 Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/14815 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
@@ -2090,6 +2090,8 @@ class Node
|
||||
*
|
||||
*/
|
||||
virtual std::string str() const = 0;
|
||||
|
||||
virtual ~Node() {};
|
||||
};
|
||||
|
||||
/** Shared pointer to a function Node. */
|
||||
|
||||
@@ -381,6 +381,8 @@ class Reservable
|
||||
|
||||
/** Free a reserved slot */
|
||||
virtual void freeReservation() = 0;
|
||||
|
||||
virtual ~Reservable() {};
|
||||
};
|
||||
|
||||
/** Wrapper for a queue type to act as a pipeline stage input queue.
|
||||
@@ -418,8 +420,6 @@ class Queue : public Named, public Reservable
|
||||
dataName(data_name)
|
||||
{ }
|
||||
|
||||
virtual ~Queue() { }
|
||||
|
||||
public:
|
||||
/** Push an element into the buffer if it isn't a bubble. Bubbles are
|
||||
* just discarded. It is assummed that any push into a queue with
|
||||
|
||||
@@ -63,6 +63,8 @@ class StreamGen
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~StreamGen() {};
|
||||
|
||||
virtual uint32_t pickStreamID() = 0;
|
||||
virtual uint32_t pickSubStreamID() = 0;
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ class QueuePolicy
|
||||
*/
|
||||
void setMemCtrl(MemCtrl* mem) { memCtrl = mem; };
|
||||
|
||||
virtual ~QueuePolicy() {};
|
||||
|
||||
protected:
|
||||
QueuePolicy(const QoSMemCtrlParams* p)
|
||||
: memCtrl(nullptr)
|
||||
|
||||
@@ -47,6 +47,8 @@ class FaultBase
|
||||
virtual FaultName name() const = 0;
|
||||
virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst =
|
||||
StaticInst::nullStaticInstPtr);
|
||||
|
||||
virtual ~FaultBase() {};
|
||||
};
|
||||
|
||||
class UnimpFault : public FaultBase
|
||||
|
||||
Reference in New Issue
Block a user