Mem: Fix size check when allocating physical memory
authorLena Olson <lena@cs.wisc.edu>
Tue, 15 May 2012 01:31:33 +0000 (20:31 -0500)
committerLena Olson <lena@cs.wisc.edu>
Tue, 15 May 2012 01:31:33 +0000 (20:31 -0500)
src/sim/system.cc

index 815a4cf1cd60a635386385475cb3c5f6a7e4c5de..906f7947f614defeca3e513bdedbeb9f52f559f6 100644 (file)
@@ -298,7 +298,7 @@ System::allocPhysPages(int npages)
 {
     Addr return_addr = pagePtr << LogVMPageSize;
     pagePtr += npages;
-    if (pagePtr > physmem.totalSize())
+    if ((pagePtr << LogVMPageSize) > physmem.totalSize())
         fatal("Out of memory, please increase size of physical memory.");
     return return_addr;
 }