From 0caf9039132d5530b2a33d1c70b734e57b4edd3b Mon Sep 17 00:00:00 2001 From: Zhaozh1x Date: Tue, 11 Sep 2018 18:31:36 +0800 Subject: [PATCH] BaseTools: Code should not update the variable that save the raw data. Code should not update the value of variable which save the original raw content of meta file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index b7b4b610ca..6106f8ee55 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1899,12 +1899,15 @@ class DscBuildData(PlatformBuildClassObject): IsArray = IsFieldValueAnArray(FieldList[FieldName][0]) if IsArray: try: - FieldList[FieldName][0] = ValueExpressionEx(FieldList[FieldName][0], TAB_VOID, self._GuidDict)(True) + FieldValue = ValueExpressionEx(FieldList[FieldName][0], TAB_VOID, self._GuidDict)(True) except BadExpression: EdkLogger.error('Build', FORMAT_INVALID, "Invalid value format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName][2])) try: - Value, ValueSize = ParseFieldValue (FieldList[FieldName][0]) + if IsArray: + Value, ValueSize = ParseFieldValue (FieldValue) + else: + Value, ValueSize = ParseFieldValue (FieldList[FieldName][0]) except Exception: EdkLogger.error('Build', FORMAT_INVALID, "Invalid value format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName][2])) if isinstance(Value, str): -- 2.39.2