summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2018-10-18 22:12:20 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-10-21 20:10:21 +0800
commit2c65efac570f14633c5001ce484dbffb8a11994a (patch)
treeefe8da42218ae0bde4c004377ee1ffa243cd314f /BaseTools
parent7cedfa1c8115f058d423b141548feb3c0d2a927f (diff)
downloadedk2-2c65efac570f14633c5001ce484dbffb8a11994a.tar.gz
edk2-2c65efac570f14633c5001ce484dbffb8a11994a.tar.bz2
edk2-2c65efac570f14633c5001ce484dbffb8a11994a.zip
BaseTools: Fix one crash bug in the report for Fixed structure Pcd
The case is: in the DSC file: SKUID_IDENTIFIER = ALL [SkuIds] 0|DEFAULT 1|A [PcdsFixedAtBuild.common.A] TokenSpaceGuid.Test401|{0x0F, 0x12} TokenSpaceGuid.Test401.TEST401INT8ARRAY[0]|'B' in the build report, Data = OverrideValues[Keys[0]], but the Keys[0] is the keyword "DEFAULT", and in this case the "DEFAULT" SKU doesn't save any value, then it cause the Data is empty, in the next code when we use the code it cause crash. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/build/BuildReport.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index 14143b3396..a66adfb167 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1091,10 +1091,11 @@ class PcdReport(object):
if not Pcd.SkuInfoList:
OverrideValues = Pcd.SkuOverrideValues
if OverrideValues:
- Keys = list(OverrideValues.keys())
- Data = OverrideValues[Keys[0]]
- Struct = list(Data.values())
- DscOverride = self.ParseStruct(Struct[0])
+ for Data in OverrideValues.values():
+ Struct = list(Data.values())
+ if Struct:
+ DscOverride = self.ParseStruct(Struct[0])
+ break
else:
SkuList = sorted(Pcd.SkuInfoList.keys())
for Sku in SkuList:
@@ -1267,12 +1268,12 @@ class PcdReport(object):
if IsStructure:
OverrideValues = Pcd.SkuOverrideValues
if OverrideValues:
- Keys = list(OverrideValues.keys())
- Data = OverrideValues[Keys[0]]
- Struct = list(Data.values())
- if Struct:
- OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
- self.PrintStructureInfo(File, OverrideFieldStruct)
+ for Data in OverrideValues.values():
+ Struct = list(Data.values())
+ if Struct:
+ OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
+ self.PrintStructureInfo(File, OverrideFieldStruct)
+ break
self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
else:
FirstPrint = True