UefiCpuPkg/RegisterCpuFeaturesLib: 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 09:42:09 +08:00
parent 8022aca8fd
commit 692e318d9d
1 changed files with 1 additions and 0 deletions

View File

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