]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the crash issue when Dynamic structure Pcd use in FDF
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 19 Oct 2018 07:15:02 +0000 (15:15 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sun, 21 Oct 2018 12:03:37 +0000 (20:03 +0800)
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 <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index f2146a77906d69ac7e896963bdfb1d991b27a0f7..804f579f5ca3149b64903c7fbce1286580f182b1 100644 (file)
@@ -569,8 +569,8 @@ class WorkspaceAutoGen(AutoGen):
                         'build',\r
                         PARSER_ERROR,\r
                         "PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name),\r
-                        File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],\r
-                        Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]\r
+                        File = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][0],\r
+                        Line = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][1]\r
                     )\r
                 else:\r
                     # Check whether Dynamic or DynamicEx PCD used in FDF file. If used, build break and give a error message.\r
@@ -583,8 +583,8 @@ class WorkspaceAutoGen(AutoGen):
                                 'build',\r
                                 PARSER_ERROR,\r
                                 "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name),\r
-                                File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],\r
-                                Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]\r
+                                File = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][0],\r
+                                Line = self.FdfProfile.PcdFileLineDict[Name, Guid, Fileds][1]\r
                         )\r
 \r
             Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)\r