]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug for BOOLEAN type value in Asbuilt inf
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 26 Apr 2017 10:19:20 +0000 (18:19 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 27 Apr 2017 13:16:43 +0000 (21:16 +0800)
When the PCD value is set to TRUE or FALSE, while it is not exchanged to
its int value, it cause error in the function int(Pcd.DefaultValue, 0).

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

index e1bdef09ca32dec12738da647e4747f5d963b0ea..8075afc91d643c1ce1d3fe9dabc2924e244124b8 100644 (file)
@@ -3925,6 +3925,13 @@ class ModuleAutoGen(AutoGen):
                 else:\r
                     continue\r
                 PcdValue = ''\r
+                if Pcd.DatumType == 'BOOLEAN':\r
+                    BoolValue = Pcd.DefaultValue.upper()\r
+                    if BoolValue == 'TRUE':\r
+                        Pcd.DefaultValue = '1'\r
+                    elif BoolValue == 'FALSE':\r
+                        Pcd.DefaultValue = '0'\r
+\r
                 if Pcd.DatumType != 'VOID*':\r
                     HexFormat = '0x%02x'\r
                     if Pcd.DatumType == 'UINT16':\r