From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1292C211982C0 for ; Tue, 11 Dec 2018 01:03:49 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 01:03:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,341,1539673200"; d="scan'208";a="282638296" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2018 01:03:48 -0800 From: BobCF To: edk2-devel@lists.01.org Cc: "Feng, Bob C" , Liming Gao , Leif Lindholm Date: Tue, 11 Dec 2018 17:03:46 +0800 Message-Id: <20181211090346.2028-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Subject: [Patch V3] BaseTools: Fixed the build fail issue for cases X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 09:03:50 -0000 Content-Transfer-Encoding: 8bit From: "Feng, Bob C" https://bugzilla.tianocore.org/show_bug.cgi?id=1386 This patch is going to fix the regression issue that is introduced by commit 72a1d77694d51914c0dd6aa97dbfa58634b0a4a5 The issue will happen in the following cases: 1. There is no Pcd value assignment in Dsc file 2. There are duplicate Pcd filed assignment Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao Cc: Leif Lindholm --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 2 +- BaseTools/Source/Python/Workspace/MetaFileParser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py index 008eee1a16..d02232b546 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -289,11 +289,11 @@ class StructurePcd(PcdClassObject): if DefaultStoreName not in self.SkuOverrideValues[SkuName]: self.SkuOverrideValues[SkuName][DefaultStoreName] = OrderedDict() if DimensionAttr not in self.SkuOverrideValues[SkuName][DefaultStoreName]: self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr] = collections.OrderedDict() if FieldName in self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr]: - del self.SkuOverrideValues[SkuName][DefaultStoreName][FieldName][DimensionAttr] + del self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr][FieldName] self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr][FieldName] = [Value.strip(), FileName, LineNo] return self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr][FieldName] def SetPcdMode (self, PcdMode): self.PcdMode = PcdMode diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 4bd52619a9..eaedba0c12 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1201,11 +1201,11 @@ class DscParser(MetaFileParser): else: self._ValueList = None return TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1) self._CurrentPcdName = TokenList[0] - if TokenList[1].strip().startswith("{CODE"): + if len(TokenList) == 2 and TokenList[1].strip().startswith("{CODE"): self._PcdDataTypeCODE = True self._PcdCodeValue = TokenList[1].strip() if self._PcdDataTypeCODE: if self._CurrentLine.endswith(")}"): -- 2.19.1.windows.1