BaseTools: Fix the bug when no FD section in the FDF file
Check if the Fdf.CurrentFdName is not None and in Fdf.Profile.FdDict before using it which fix a crash issue when no FD section in FDF file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19747 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -317,11 +317,12 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
GlobalData.gFdfParser = Fdf
|
GlobalData.gFdfParser = Fdf
|
||||||
GlobalData.gAutoGenPhase = False
|
GlobalData.gAutoGenPhase = False
|
||||||
PcdSet = Fdf.Profile.PcdDict
|
PcdSet = Fdf.Profile.PcdDict
|
||||||
FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
|
if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
|
||||||
for FdRegion in FdDict.RegionList:
|
FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
|
||||||
if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
for FdRegion in FdDict.RegionList:
|
||||||
if int(FdRegion.Offset) % 8 != 0:
|
if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
||||||
EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
|
if int(FdRegion.Offset) % 8 != 0:
|
||||||
|
EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
|
||||||
ModuleList = Fdf.Profile.InfList
|
ModuleList = Fdf.Profile.InfList
|
||||||
self.FdfProfile = Fdf.Profile
|
self.FdfProfile = Fdf.Profile
|
||||||
for fvname in self.FvTargetList:
|
for fvname in self.FvTargetList:
|
||||||
|
Reference in New Issue
Block a user