From 770b84c2ee098efdc7a0fa768334d45ab9720de6 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 28 Nov 2022 13:02:49 -0800 Subject: [PATCH] sim: Add missing virtual destructor to GlobalSyncEvent This missing destructor in GlobalSyncEvent was causing a compilation error in gcc-12, thus causing the compiler-tests to fail: https://jenkins.gem5.org/job/compiler-checks/436/ In addition a destructor was added to BaseGlobalEventTemplate. This does not directly fix the aforementioned bug provides some additional security. Change-Id: Iab86d3f6d55064ba3b6a8a7cb01fb14533cce4b9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66152 Maintainer: Jason Lowe-Power Tested-by: kokoro Maintainer: Bobby Bruce Reviewed-by: Jason Lowe-Power --- src/sim/global_event.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sim/global_event.hh b/src/sim/global_event.hh index 05ae6ca9ad..36332043c6 100644 --- a/src/sim/global_event.hh +++ b/src/sim/global_event.hh @@ -162,6 +162,8 @@ class BaseGlobalEventTemplate : public BaseGlobalEvent for (int i = 0; i < numMainEventQueues; ++i) barrierEvent[i] = new typename Derived::BarrierEvent(this, p, f); } + + virtual ~BaseGlobalEventTemplate(){} }; @@ -229,6 +231,8 @@ class GlobalSyncEvent : public BaseGlobalEventTemplate schedule(when); } + virtual ~GlobalSyncEvent (){} + void process(); const char *description() const;