Mem: Fix size check when allocating physical memory

This commit is contained in:
Lena Olson
2012-05-14 20:31:33 -05:00
parent 7f14ea0c00
commit 8fe8efeb34

View 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;
}