mem-cache: Avoid calling .front() on a possibly empty std::list
In the call to MSHR::promoteWritable() the deferredTargets list can be empty, so we should check that case before calling .front(). The new logic matches MSHR::promoteReadable(). Change-Id: Ic1d05e42f32b2c02226ca88d2155225f592f667f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57249 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
3
src/mem/cache/mshr.cc
vendored
3
src/mem/cache/mshr.cc
vendored
@@ -678,6 +678,9 @@ MSHR::promoteReadable()
|
||||
void
|
||||
MSHR::promoteWritable()
|
||||
{
|
||||
if (deferredTargets.empty()) {
|
||||
return;
|
||||
}
|
||||
PacketPtr def_tgt_pkt = deferredTargets.front().pkt;
|
||||
if (deferredTargets.needsWritable &&
|
||||
!(hasPostInvalidate() || hasPostDowngrade()) &&
|
||||
|
||||
Reference in New Issue
Block a user