diff options
author | Zhang, Shenglei <shenglei.zhang@intel.com> | 2019-08-12 14:24:44 +0800 |
---|---|---|
committer | Hao A Wu <hao.a.wu@intel.com> | 2019-08-14 09:04:04 +0800 |
commit | 46f8a6891606746ca8b1e684ac379ce271306dc0 (patch) | |
tree | 4221e5b0b5b73a8bb1db7bea3359e81f421ef90b | |
parent | 073f2cede820782e37e31bd6664aa53b79bbade4 (diff) | |
download | edk2-46f8a6891606746ca8b1e684ac379ce271306dc0.zip edk2-46f8a6891606746ca8b1e684ac379ce271306dc0.tar.gz edk2-46f8a6891606746ca8b1e684ac379ce271306dc0.tar.bz2 |
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>
-rw-r--r-- | MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c index b40b7e0..2389f3e 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
|