From: Yonghong Zhu Date: Fri, 19 Oct 2018 07:15:02 +0000 (+0800) Subject: BaseTools: Fix the crash issue when Dynamic structure Pcd use in FDF X-Git-Tag: edk2-stable201903~785 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=eb99b52f9888e99f449b8b984ee5a095027b5fd9 BaseTools: Fix the crash issue when Dynamic structure Pcd use in FDF 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 Reviewed-by: Jaben Carsey --- diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index f2146a7790..804f579f5c 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -569,8 +569,8 @@ class WorkspaceAutoGen(AutoGen): '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. @@ -583,8 +583,8 @@ class WorkspaceAutoGen(AutoGen): '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)