From afe8c4110c072126b9fb3821397a0216bf7dd8ad Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Thu, 9 May 2019 17:19:56 +0800 Subject: BaseTools: Correct the value assignment for StructurePcd BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1752 This patch is to fix the code bug in StructurePcd overall value assignment logic. If a Pcd Array size is fixed but the size of actual value in Dsc or Dec is bigger than the Pcd array size, the tool will report error about such setting and stop build. The patch is tested minplatform, Ovmf, structure pcd regression test These tests are build pass. The patch also tested the following cases. Our cases focused on PcdArraySize. 1.flexiable PcdArraySize. 2.Fixed PcdArraySize, Pcd overall value exceeds the size of PcdArray. 3.Fixed PcdArraySize, Pcd overall value Not exceeds the size of PcdArray. Signed-off-by: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/DecBuildData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Workspace/DecBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/Source/Python/Workspace/DecBuildData.py index d58d88eca7..30826a3cea 100644 --- a/BaseTools/Source/Python/Workspace/DecBuildData.py +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py @@ -395,7 +395,7 @@ class DecBuildData(PackageBuildClassObject): struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName = pcdname.split(".") struct_pcd.PcdDefineLineNo = LineNo struct_pcd.PkgPath = self.MetaFile.File - struct_pcd.SetDecDefaultValue(item.DefaultValue) + struct_pcd.SetDecDefaultValue(item.DefaultValue,self.MetaFile.File,LineNo) else: DemesionAttr, Fields = self.ParsePcdName(item.TokenCName) struct_pcd.AddDefaultValue(Fields, item.DefaultValue, self.MetaFile.File, LineNo,DemesionAttr) -- cgit v1.2.3