cpu: Use the NotAnInst flag to avoid passing an inst to fetch faults.
[gem5.git] / src / cpu / o3 / commit_impl.hh
index b3a97ad3a307e4f1aa6576318d75cd60be2d5fa8..d32493cbcf18dd5ce955320dbcfca64f7a97e9b4 100644 (file)
@@ -1225,7 +1225,10 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
         // needed to update the state as soon as possible.  This
         // prevents external agents from changing any specific state
         // that the trap need.
-        cpu->trap(inst_fault, tid, head_inst->staticInst);
+        cpu->trap(inst_fault, tid,
+                  head_inst->notAnInst() ?
+                      StaticInst::nullStaticInstPtr :
+                      head_inst->staticInst);
 
         // Exit state update mode to avoid accidental updating.
         thread[tid]->noSquashFromTC = false;