summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2018-10-25 09:42:09 +0800
committerEric Dong <eric.dong@intel.com>2018-10-26 11:28:36 +0800
commit692e318d9d256aa3ab802b02f4dfba0eed5f2ee4 (patch)
treeb7c5ec7a05352db2c8b1a3461281c8ccda3d24c7
parent8022aca8fd1b274c9046ae175c5af4290128f0ae (diff)
downloadedk2-692e318d9d256aa3ab802b02f4dfba0eed5f2ee4.tar.gz
edk2-692e318d9d256aa3ab802b02f4dfba0eed5f2ee4.tar.xz
edk2-692e318d9d256aa3ab802b02f4dfba0eed5f2ee4.zip
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>
-rw-r--r--UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index 7a5939c966..173f2edbea 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -1029,6 +1029,7 @@ SetProcessorRegister (
InitApicId = GetInitialApicId ();
RegisterTable = NULL;
+ ProcIndex = (UINTN)-1;
for (Index = 0; Index < AcpiCpuData->NumberOfCpus; Index++) {
if (RegisterTables[Index].InitialApicId == InitApicId) {
RegisterTable = &RegisterTables[Index];