From 7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 26 Apr 2017 18:19:20 +0800 Subject: [PATCH] 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +++++++ 1 file changed, 7 insertions(+) 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':