summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 47791beaa..eb66f7825 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 + npages - 1 >= physmem->size())
+ if (pagePtr > physmem->size())
fatal("Out of memory, please increase size of physical memory.");
return return_addr;
}