summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 83610a102..47791beaa 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -296,7 +296,7 @@ System::allocPhysPages(int npages)
{
Addr return_addr = pagePtr << LogVMPageSize;
pagePtr += npages;
- if (return_addr >= physmem->size())
+ if (return_addr + npages - 1 >= physmem->size())
fatal("Out of memory, please increase size of physical memory.");
return return_addr;
}