BaseTools:Expression.py Adding a check for missing '}' in the parser

This check is to catch cases where a missing '}' exists in a dec or dsc
file.

Signed-off-by: Doug Flick <dougflick@microsoft.com>
This commit is contained in:
Doug Flick 2025-04-14 09:55:49 -07:00 committed by mergify[bot]
parent 1805068b5e
commit 0f1c0d2d2d

View file

@ -917,7 +917,7 @@ class ValueExpressionEx(ValueExpression):
TmpList.append('0x%02x' % ((TmpValue >> I * 8) & 0xff))
PcdValue = '{' + ', '.join(TmpList) + '}'
except:
if PcdValue.strip().startswith('{'):
if PcdValue.strip().startswith('{') and PcdValue.strip().endswith('}'):
PcdValueList = SplitPcdValueString(PcdValue.strip()[1:-1])
LabelDict = {}
NewPcdValueList = []