From 1805068b5ef41572569da02f2347317d5665ddee Mon Sep 17 00:00:00 2001 From: Doug Flick Date: Fri, 11 Apr 2025 16:06:09 -0700 Subject: BaseTools:Expression.py Add Assertion for PCD with value {} This adds an assertion to the PCD class in the Expression.py file to check for zero-byte PCDs. Signed-off-by: Doug Flick --- BaseTools/Source/Python/Common/Expression.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'BaseTools/Source/Python/Common/Expression.py') diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index 4860ace11a..138b38c927 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -1027,6 +1027,8 @@ class ValueExpressionEx(ValueExpression): if Size > 0: PcdValue = '{' + ', '.join(AllPcdValueList) + '}' + else: + raise BadExpression("PCD with value '%s' cannot be used. Please provide a valid value of at least one byte." % (self.PcdValue)) else: raise BadExpression("Type: %s, Value: %s, %s"%(self.PcdType, PcdValue, Value)) -- cgit v1.2.3