sim: Fix as issue where exit events on instr queues are used after freed.

This commit is contained in:
Ali Saidi 2012-11-02 11:32:00 -05:00
parent 4440332bdd
commit d0678d1c31
2 changed files with 3 additions and 2 deletions

View file

@ -203,7 +203,8 @@ EventQueue::serviceOne()
if (!event->squashed()) { if (!event->squashed()) {
event->process(); event->process();
if (event->isExitEvent()) { 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; return event;
} }
} else { } else {

View file

@ -56,7 +56,7 @@ SimLoopExitEvent::process()
// queue. // queue.
if (!isFlagSet(IsMainQueue)) { if (!isFlagSet(IsMainQueue)) {
exitSimLoop(cause, code); exitSimLoop(cause, code);
delete this; setFlags(AutoDelete);
} }
// otherwise do nothing... the IsExitEvent flag takes care of // otherwise do nothing... the IsExitEvent flag takes care of