summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorZhang, Shenglei <shenglei.zhang@intel.com>2019-08-12 14:24:44 +0800
committerHao A Wu <hao.a.wu@intel.com>2019-08-14 09:04:04 +0800
commit46f8a6891606746ca8b1e684ac379ce271306dc0 (patch)
tree4221e5b0b5b73a8bb1db7bea3359e81f421ef90b /MdeModulePkg/Core
parent073f2cede820782e37e31bd6664aa53b79bbade4 (diff)
downloadedk2-46f8a6891606746ca8b1e684ac379ce271306dc0.tar.gz
edk2-46f8a6891606746ca8b1e684ac379ce271306dc0.tar.bz2
edk2-46f8a6891606746ca8b1e684ac379ce271306dc0.zip
MdeModulePkg/DxeIplPeim: Relocate operation of PageMapLevel5Entry++
This commit will fix a GCC 4.8.5 build failure introduced by commit b3527dedc3951f061c5a73cb4fb2b0f95f47e08b. PageMapLevel5Entry may be uninitialized in original code, which means uninitialized pointer will be modified at some circumstance. So relocate the operation of PageMapLevel5Entry++ in order to make sure the pointer could be modified only when it is initialized. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
index b40b7e0c98..2389f3eb48 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
@@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
for ( IndexOfPml5Entries = 0
; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
- ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
+ ; IndexOfPml5Entries++) {
//
// Each PML5 entry points to a page of PML4 entires.
// So lets allocate space for them and fill them in in the IndexOfPml4Entries loop.
@@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry | AddressEncMask;
PageMapLevel5Entry->Bits.ReadWrite = 1;
PageMapLevel5Entry->Bits.Present = 1;
+ PageMapLevel5Entry++;
}
for ( IndexOfPml4Entries = 0