From: Lena Olson Date: Tue, 15 May 2012 01:31:33 +0000 (-0500) Subject: Mem: Fix size check when allocating physical memory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8fe8efeb34ae33e36bff77c4eb42d1ebfa95a7e8;p=gem5.git Mem: Fix size check when allocating physical memory --- diff --git a/src/sim/system.cc b/src/sim/system.cc index 815a4cf1c..906f7947f 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -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; }