UefiCpuPkg/PiSmmCpuDxeSmm: Fix build failure for VS2012 and GCC49.

Code initialized in function can't be correctly detected by build tool.
Add code to clearly initialize the local variable before use it.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Eric Dong 2018-10-25 10:12:52 +08:00
parent 31fb333431
commit 7db4034f9a
1 changed files with 1 additions and 0 deletions

View File

@ -451,6 +451,7 @@ SetRegister (
InitApicId = GetInitialApicId (); InitApicId = GetInitialApicId ();
RegisterTable = NULL; RegisterTable = NULL;
ProcIndex = (UINTN)-1;
for (Index = 0; Index < mAcpiCpuData.NumberOfCpus; Index++) { for (Index = 0; Index < mAcpiCpuData.NumberOfCpus; Index++) {
if (RegisterTables[Index].InitialApicId == InitApicId) { if (RegisterTables[Index].InitialApicId == InitApicId) {
RegisterTable = &RegisterTables[Index]; RegisterTable = &RegisterTables[Index];