diff options
author | Doug Flick <dougflick@microsoft.com> | 2025-04-03 13:32:48 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-04-14 20:53:02 +0000 |
commit | a1b623b938b8aa2a019c11f7c07eca7504a03749 (patch) | |
tree | 6ce21880e7f3ee6d86c8853a1416e552b52464c2 /BaseTools/Source/Python/Common/Expression.py | |
parent | fdede2e1eaa44119aabb4d29e2c6812d758fb953 (diff) | |
download | edk2-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.py | 2 |
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(')'):
|