Fix crash in GetMemoryMap() when memory type 0x80000000-0xFFFFFFFF was allocated by OS loader

Signed-off-by: niruiyu
Reviewed-by: lgao4
Reviewed-by: hhtian

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11774 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu 2011-06-09 02:01:19 +00:00
parent 1b65880229
commit 10fe0d814a

View File

@ -1464,9 +1464,11 @@ CoreGetMemoryMap (
} }
} }
MemoryMap->Attribute = Entry->Attribute; MemoryMap->Attribute = Entry->Attribute;
if (MemoryMap->Type < EfiMaxMemoryType) {
if (mMemoryTypeStatistics[MemoryMap->Type].Runtime) { if (mMemoryTypeStatistics[MemoryMap->Type].Runtime) {
MemoryMap->Attribute |= EFI_MEMORY_RUNTIME; MemoryMap->Attribute |= EFI_MEMORY_RUNTIME;
} }
}
// //
// Check to see if the new Memory Map Descriptor can be merged with an // Check to see if the new Memory Map Descriptor can be merged with an