summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/AutoGen/AutoGen.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-04-26 13:19:20 +0300
committerYonghong Zhu <yonghong.zhu@intel.com>2017-04-27 16:16:43 +0300
commit7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6 (patch)
tree90dd49cd3c6011b2d671d979ec1c305d80c53944 /BaseTools/Source/Python/AutoGen/AutoGen.py
parent227fe49d5d4fe6513fc09766f1c9f3ff330ea845 (diff)
downloadedk2-7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6.tar.xz
BaseTools: Fix a bug for BOOLEAN type value in Asbuilt inf
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index e1bdef09ca..8075afc91d 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3925,6 +3925,13 @@ class ModuleAutoGen(AutoGen):
else:
continue
PcdValue = ''
+ if Pcd.DatumType == 'BOOLEAN':
+ BoolValue = Pcd.DefaultValue.upper()
+ if BoolValue == 'TRUE':
+ Pcd.DefaultValue = '1'
+ elif BoolValue == 'FALSE':
+ Pcd.DefaultValue = '0'
+
if Pcd.DatumType != 'VOID*':
HexFormat = '0x%02x'
if Pcd.DatumType == 'UINT16':