diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-01-26 08:45:34 +0000 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-02-24 15:30:05 +0800 |
commit | 7c43c0b0310adcee16a1f465f7b5cfdf9692a5d1 (patch) | |
tree | 800867a9b99740847909988abd593dd3543f3eed /BaseTools/Source | |
parent | 926dd14537a8f99649db5ad0be1df551b2bcb704 (diff) | |
download | edk2-platforms-7c43c0b0310adcee16a1f465f7b5cfdf9692a5d1.tar.xz |
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
(cherry picked from commit cb04330eee96f3afc8d9f060b69859e3c068c3c9)
Diffstat (limited to 'BaseTools/Source')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index e9f4888aa1..dfb5b72b13 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -317,11 +317,12 @@ class WorkspaceAutoGen(AutoGen): GlobalData.gFdfParser = Fdf
GlobalData.gAutoGenPhase = False
PcdSet = Fdf.Profile.PcdDict
- FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
- for FdRegion in FdDict.RegionList:
- if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
- if int(FdRegion.Offset) % 8 != 0:
- EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
+ if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
+ FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
+ for FdRegion in FdDict.RegionList:
+ if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
+ 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
self.FdfProfile = Fdf.Profile
for fvname in self.FvTargetList:
|