summaryrefslogtreecommitdiff
path: root/src/mem/abstract_mem.hh
diff options
context:
space:
mode:
authorTiago Muck <tiago.muck@arm.com>2018-12-12 15:52:41 -0600
committerTiago Mück <tiago.muck@arm.com>2019-05-22 19:43:36 +0000
commitb8a4c876905d605cf180e77f7d1bb08f2ed22940 (patch)
treedd19be708a9e321230ab17b28bf27fcb20c66f49 /src/mem/abstract_mem.hh
parentc022369490ec94e332f6a09826ef3fc6ad063ca2 (diff)
downloadgem5-b8a4c876905d605cf180e77f7d1bb08f2ed22940.tar.xz
mem: Add invalid context id check on LLSC checks
If the request's address is in the LLSC list, its context Id was being fetched unconditionally, which could cause the assert at Request::contextId() to fail. Change-Id: Iae9791f81c8fe9a7fcd842cd8ab7db18f34f2808 Signed-off-by: Tiago Muck <tiago.muck@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18792 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/mem/abstract_mem.hh')
-rw-r--r--src/mem/abstract_mem.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh
index 18d8ee909..8b944b981 100644
--- a/src/mem/abstract_mem.hh
+++ b/src/mem/abstract_mem.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012, 2019 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -83,6 +83,8 @@ class LockedAddr {
// check for matching execution context
bool matchesContext(const RequestPtr &req) const
{
+ assert(contextId != InvalidContextID);
+ assert(req->hasContextId());
return (contextId == req->contextId());
}