summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Core/Dxe/Gcd/Gcd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
index ab8677a..05f711d 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -393,10 +393,10 @@ CoreInsertGcdMapEntry (
)
{
ASSERT (Length != 0);
- ASSERT (TopEntry->Signature == 0);
- ASSERT (BottomEntry->Signature == 0);
if (BaseAddress > Entry->BaseAddress) {
+ ASSERT (BottomEntry->Signature == 0);
+
CopyMem (BottomEntry, Entry, sizeof (EFI_GCD_MAP_ENTRY));
Entry->BaseAddress = BaseAddress;
BottomEntry->EndAddress = BaseAddress - 1;
@@ -404,6 +404,8 @@ CoreInsertGcdMapEntry (
}
if ((BaseAddress + Length - 1) < Entry->EndAddress) {
+ ASSERT (TopEntry->Signature == 0);
+
CopyMem (TopEntry, Entry, sizeof (EFI_GCD_MAP_ENTRY));
TopEntry->BaseAddress = BaseAddress + Length;
Entry->EndAddress = BaseAddress + Length - 1;