diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-04-26 18:19:20 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:28 +0800 |
commit | 5b346b2340cb192be4e6ddf056c4960e635145ac (patch) | |
tree | d375f4f1a23787c7dc9840185e8fa988a07b3655 | |
parent | e0b0bb4224550e3c15f1008d5475fee9de26f84a (diff) | |
download | edk2-platforms-5b346b2340cb192be4e6ddf056c4960e635145ac.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>
-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':
|