REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1276
Fixed potentially uninitialized variable build failure
caused by commit:
b1cc6f672f3b924cdb190e5b92db3b47f46a8911
Test: Verified on internal platform and boots successfully.
Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
}\r
IdtSize = sizeof (IdtTableInStack.IdtTable);\r
} else {\r
- if (IdtDescriptor.Limit + 1 > sizeof (IdtTableInStack.IdtTable)) {\r
+ IdtSize = IdtDescriptor.Limit + 1;\r
+ if (IdtSize > sizeof (IdtTableInStack.IdtTable)) {\r
//\r
// ERROR: IDT table size from boot loader is larger than FSP can support, DeadLoop here!\r
//\r
CpuDeadLoop();\r
- } else {\r
- IdtSize = IdtDescriptor.Limit + 1;\r
}\r
CopyMem ((VOID *) (UINTN) &IdtTableInStack.IdtTable, (VOID *) IdtDescriptor.Base, IdtSize);\r
}\r