summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-06-23 14:34:32 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-06-24 23:04:29 +0800
commit9f14de3b8eb9520d0c88b03335d91763a8d64c0f (patch)
tree455726d8f85176ba1db51b54f2e9d2b5ac8d0423 /BaseTools
parent413d51cc2bcf608844cf5362535bdd2a9a8b2b5b (diff)
downloadedk2-9f14de3b8eb9520d0c88b03335d91763a8d64c0f.tar.gz
edk2-9f14de3b8eb9520d0c88b03335d91763a8d64c0f.tar.bz2
edk2-9f14de3b8eb9520d0c88b03335d91763a8d64c0f.zip
BaseTools: report error HiiString in HII format PCD must not be empty
Add a check that HiiString field in the HII format PCD entry must not be an empty string. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 6e236e68b0..e98352ade5 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1139,6 +1139,13 @@ class DscParser(MetaFileParser):
EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s' of PCD is wrong" % ValueList[1],
ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+ # Validate the VariableName of DynamicHii and DynamicExHii for PCD Entry must not be an empty string
+ if self._ItemType in [MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII]:
+ DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+ if len(DscPcdValueList[0].replace('L','').replace('"','').strip()) == 0:
+ EdkLogger.error('Parser', FORMAT_INVALID, "The VariableName field in the HII format PCD entry must not be an empty string",
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
# if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
if DscPcdValueList[0] in ['True', 'true', 'TRUE']: