From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 EF6E42117AE77 for ; Fri, 19 Oct 2018 00:20:52 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2018 00:20:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,399,1534834800"; d="scan'208";a="82449446" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.127]) by orsmga007.jf.intel.com with ESMTP; 19 Oct 2018 00:20:51 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 19 Oct 2018 15:20:49 +0800 Message-Id: <1539933649-9672-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix the crash issue when Dynamic structure Pcd use in FDF 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: Fri, 19 Oct 2018 07:20:53 -0000 The case is use Dynamic structure Pcd in the FDF file. Current code already save the Guid, Name and Filed info for those Pcd, but it directly use the dict key as [Name, Guid] and cause this crash issue. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1264 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/AutoGen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index f2146a7..804f579 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -567,12 +567,12 @@ class WorkspaceAutoGen(AutoGen): if (Name, Guid) not in DecPcds: EdkLogger.error( 'build', PARSER_ERROR, "PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name), - File = self.FdfProfile.PcdFileLineDict[Name, Guid][0], - Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1] + File = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][0], + Line = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][1] ) else: # Check whether Dynamic or DynamicEx PCD used in FDF file. If used, build break and give a error message. if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \ or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in DecPcdsKey \ @@ -581,12 +581,12 @@ class WorkspaceAutoGen(AutoGen): elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey: EdkLogger.error( 'build', PARSER_ERROR, "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name), - File = self.FdfProfile.PcdFileLineDict[Name, Guid][0], - Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1] + File = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][0], + Line = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][1] ) Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch) # # Explicitly collect platform's dynamic PCDs -- 2.6.1.windows.1