Properly chack the pkt pointer on upgrades to insure no segfaults when writebacks...
authorRon Dreslinski <rdreslin@umich.edu>
Tue, 17 Oct 2006 19:07:40 +0000 (15:07 -0400)
committerRon Dreslinski <rdreslin@umich.edu>
Tue, 17 Oct 2006 19:07:40 +0000 (15:07 -0400)
--HG--
extra : convert_revision : 72b1c6296a16319f4d16c62bc7038365654dbc40

src/mem/cache/cache_impl.hh

index fc559195d05d41a0287b286370cb0dc6af5e6a7d..a64ce4e09296906883b09ec749c6978b3b16f2bc 100644 (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;