summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Expression.py
diff options
context:
space:
mode:
authorDoug Flick <dougflick@microsoft.com>2025-04-03 13:32:48 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-04-14 20:53:02 +0000
commita1b623b938b8aa2a019c11f7c07eca7504a03749 (patch)
tree6ce21880e7f3ee6d86c8853a1416e552b52464c2 /BaseTools/Source/Python/Common/Expression.py
parentfdede2e1eaa44119aabb4d29e2c6812d758fb953 (diff)
downloadedk2-a1b623b938b8aa2a019c11f7c07eca7504a03749.tar.gz
edk2-a1b623b938b8aa2a019c11f7c07eca7504a03749.tar.bz2
edk2-a1b623b938b8aa2a019c11f7c07eca7504a03749.zip
BaseTools:Expression.py Size used before Init
The following example fails to be parsed correctly due to Size being used in the outer scope but initialized in the inner scope ``` gPlatformPkgTokenSpaceGuid.PcdSecureBootDbxBinaryFile|{} ``` Problematic code: ```python for Item in NewPcdValueList: Size = 0 # .... if Size > 0: PcdValue = '{' + ', '.join(AllPcdValueList) + '}' ```` Signed-off-by: Doug Flick <dougflick@microsoft.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/Expression.py')
-rw-r--r--BaseTools/Source/Python/Common/Expression.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
index 9d9cb0c929..4860ace11a 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -969,8 +969,8 @@ class ValueExpressionEx(ValueExpression):
NewPcdValueList.append(Item)
AllPcdValueList = []
+ Size = 0
for Item in NewPcdValueList:
- Size = 0
ValueStr = ''
TokenSpaceGuidName = ''
if Item.startswith(TAB_GUID) and Item.endswith(')'):