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>
\r
for ( IndexOfPml5Entries = 0\r
; IndexOfPml5Entries < NumberOfPml5EntriesNeeded\r
- ; IndexOfPml5Entries++, PageMapLevel5Entry++) {\r
+ ; IndexOfPml5Entries++) {\r
//\r
// Each PML5 entry points to a page of PML4 entires.\r
// So lets allocate space for them and fill them in in the IndexOfPml4Entries loop.\r
PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry | AddressEncMask;\r
PageMapLevel5Entry->Bits.ReadWrite = 1;\r
PageMapLevel5Entry->Bits.Present = 1;\r
+ PageMapLevel5Entry++;\r
}\r
\r
for ( IndexOfPml4Entries = 0\r