Properly chack the pkt pointer on upgrades to insure no segfaults when writebacks delete the packet.

--HG--
extra : convert_revision : 72b1c6296a16319f4d16c62bc7038365654dbc40
This commit is contained in:
Ron Dreslinski 2006-10-17 15:07:40 -04:00
parent 288b98eb69
commit 6e8bfa4e63

View file

@ -272,10 +272,11 @@ template<class TagStore, class Buffering, class Coherence>
void
Cache<TagStore,Buffering,Coherence>::sendResult(PacketPtr &pkt, MSHR* mshr, bool success)
{
if (success && !(pkt->flags & NACKED_LINE)) {
if (success && !(pkt && (pkt->flags & NACKED_LINE))) {
missQueue->markInService(mshr->pkt, mshr);
//Temp Hack for UPGRADES
if (mshr->pkt->cmd == Packet::UpgradeReq) {
assert(pkt); //Upgrades need to be fixed
pkt->flags &= ~CACHE_LINE_FILL;
BlkType *blk = tags->findBlock(pkt);
CacheBlk::State old_state = (blk) ? blk->status : 0;