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 <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Yonghong Zhu 2018-10-19 15:15:02 +08:00
parent c3d0f526c0
commit eb99b52f98
1 changed files with 4 additions and 4 deletions

View File

@ -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)