summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorSteve Reinhardt <Steve.Reinhardt@amd.com>2008-11-10 14:11:07 -0800
committerSteve Reinhardt <Steve.Reinhardt@amd.com>2008-11-10 14:11:07 -0800
commit63127cbf37ac9b37096c5ede06c929069a5ceb49 (patch)
tree6864d3fec8b7b043f3533f8dad70ad990a1a7837 /src/mem
parent42bd460d7f91f4d0f76901a8d661d5fe6292b7f2 (diff)
downloadgem5-63127cbf37ac9b37096c5ede06c929069a5ceb49.tar.xz
mem: Assert that requests have non-negative size.
Would have saved me much debugging time if these had been in there previously.
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/request.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh
index da0d9c7e0..d1e011c7d 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -172,6 +172,7 @@ class Request : public FastAlloc
* allocated Request object. */
void setPhys(Addr _paddr, int _size, int _flags)
{
+ assert(_size >= 0);
paddr = _paddr;
size = _size;
flags = _flags;
@@ -188,6 +189,7 @@ class Request : public FastAlloc
* allocated Request object. */
void setVirt(int _asid, Addr _vaddr, int _size, int _flags, Addr _pc)
{
+ assert(_size >= 0);
asid = _asid;
vaddr = _vaddr;
size = _size;