gem5: fix a number of use after free issues

This commit is contained in:
Ali Saidi 2012-05-10 18:04:27 -05:00
parent da10fbf5ca
commit 5ecaf30219
2 changed files with 5 additions and 4 deletions

View file

@ -264,13 +264,14 @@ CheckerCPU::writeMem(uint8_t *data, unsigned size,
* enabled. This is left as future work for the Checker: LSQ snooping
* and memory validation after stores have committed.
*/
bool was_prefetch = memReq->isPrefetch();
delete memReq;
//If we don't need to access a second cache line, stop now.
if (fault != NoFault || secondAddr <= addr)
{
if (fault != NoFault && memReq->isPrefetch()) {
if (fault != NoFault && was_prefetch) {
fault = NoFault;
}
break;

View file

@ -516,11 +516,11 @@ EventQueue::deschedule(Event *event)
event->flags.clear(Event::Squashed);
event->flags.clear(Event::Scheduled);
if (event->flags.isSet(Event::AutoDelete))
delete event;
if (DTRACE(Event))
event->trace("descheduled");
if (event->flags.isSet(Event::AutoDelete))
delete event;
}
inline void