summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-11-02 11:32:00 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-11-02 11:32:00 -0500
commitd0678d1c31bbb0c08e58762a36d5d2382b0a537f (patch)
tree78c50afdcec4a036d9040ab271e724e146b19f87 /src
parent4440332bdd44453e5a301a46eabbab1e85fa8cfb (diff)
downloadgem5-d0678d1c31bbb0c08e58762a36d5d2382b0a537f.tar.xz
sim: Fix as issue where exit events on instr queues are used after freed.
Diffstat (limited to 'src')
-rw-r--r--src/sim/eventq.cc3
-rw-r--r--src/sim/sim_events.cc2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index b389efcf2..b32b330e7 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -203,7 +203,8 @@ EventQueue::serviceOne()
if (!event->squashed()) {
event->process();
if (event->isExitEvent()) {
- assert(!event->flags.isSet(Event::AutoDelete)); // would be silly
+ assert(!event->flags.isSet(Event::AutoDelete) ||
+ !event->flags.isSet(Event::IsMainQueue)); // would be silly
return event;
}
} else {
diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc
index 725e7da9d..a77e8b103 100644
--- a/src/sim/sim_events.cc
+++ b/src/sim/sim_events.cc
@@ -56,7 +56,7 @@ SimLoopExitEvent::process()
// queue.
if (!isFlagSet(IsMainQueue)) {
exitSimLoop(cause, code);
- delete this;
+ setFlags(AutoDelete);
}
// otherwise do nothing... the IsExitEvent flag takes care of