BaseTools: Fix bug for --pcd VOID* type when no max size is specified
authorYonghong Zhu <yonghong.zhu@intel.com>
Tue, 20 Mar 2018 05:16:12 +0000 (13:16 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 20 Mar 2018 08:56:04 +0000 (16:56 +0800)
when VOID* type non-structure pcd used in --pcd, and its max size is not
specified in DSC or its value is hex value, build break due to the code
int(Pcd.MaxDatumSize,10).
Now this patch remove this code, because tool will calculate the size
info in later phase.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/Workspace/DscBuildData.py

index 87494df..d60d491 100644 (file)
@@ -1254,19 +1254,6 @@ class DscBuildData(PlatformBuildClassObject):
                             SkuInfo.HiiDefaultValue = NoFiledValues[(Pcd.TokenSpaceGuidCName,Pcd.TokenCName)][0]\r
                             for defaultstore in SkuInfo.DefaultStoreDict:\r
                                 SkuInfo.DefaultStoreDict[defaultstore] = NoFiledValues[(Pcd.TokenSpaceGuidCName,Pcd.TokenCName)][0]\r
-                    if Pcd.DatumType == "VOID*":\r
-                        if Pcd.MaxDatumSize is None:\r
-                            Pcd.MaxDatumSize = '0'\r
-                        MaxSize = int(Pcd.MaxDatumSize,10)\r
-                        if Pcd.DefaultValue.startswith("{") and Pcd.DefaultValue.endswith("}"):\r
-                            MaxSize = max([len(Pcd.DefaultValue.split(",")),MaxSize])\r
-                        elif Pcd.DefaultValue.startswith("\"") or Pcd.DefaultValue.startswith("\'"):\r
-                            MaxSize = max([len(Pcd.DefaultValue)-2+1,MaxSize])\r
-                        elif Pcd.DefaultValue.startswith("L\""):\r
-                            MaxSize = max([2*(len(Pcd.DefaultValue)-3+1),MaxSize])\r
-                        else:\r
-                            MaxSize = max([len(Pcd.DefaultValue),MaxSize])\r
-                        Pcd.MaxDatumSize = str(MaxSize)\r
             else:\r
                 PcdInDec = self.DecPcds.get((Name,Guid))\r
                 if PcdInDec:\r