cpu: Fix setTranslateLatency() bug for squashed instructions

setTranslateLatency could sometimes improperly access a deleted request
packet after an instruction was squashed.
This commit is contained in:
Mitchell Hayenga 2014-04-23 05:18:26 -04:00
parent 2031c03c09
commit bf25c53a7d

View file

@ -255,8 +255,11 @@ class DataTranslation : public BaseTLB::Translation
assert(state);
assert(mode == state->mode);
if (state->finish(fault, index)) {
if (state->getFault() == NoFault) {
// Don't access the request if faulted (due to squash)
req->setTranslateLatency();
}
xc->finishTranslation(state);
req->setTranslateLatency();
}
delete this;
}