diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-04-26 18:19:20 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-04-27 21:16:43 +0800 |
commit | 7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6 (patch) | |
tree | 90dd49cd3c6011b2d671d979ec1c305d80c53944 /BaseTools/Source/Python | |
parent | 227fe49d5d4fe6513fc09766f1c9f3ff330ea845 (diff) | |
download | edk2-7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6.tar.gz edk2-7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6.tar.bz2 edk2-7ced8bb49b69cb2b443f2c357fae8c8b5b75aac6.zip |
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')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 7 |
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':
|