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>
This commit is contained in:
Yonghong Zhu 2017-04-26 18:19:20 +08:00
parent 227fe49d5d
commit 7ced8bb49b
1 changed files with 7 additions and 0 deletions

View File

@ -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':