summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
index d901336366..9a54a3e579 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
@@ -593,14 +593,25 @@ public class Token {
public boolean isValidNullValue(String judgedValue) {
int intValue;
+ String subStr;
BigInteger bigIntValue;
switch (datumType) {
case UINT8:
case UINT16:
case UINT32:
- intValue = Integer.decode(judgedValue);
- if (intValue == 0) {
+ if (judgedValue.length() > 2) {
+ if ((judgedValue.charAt(0) == '0') &&
+ ((judgedValue.charAt(1) == 'x') || (judgedValue.charAt(1) == 'X'))){
+ subStr = judgedValue.substring(2, judgedValue.length());
+ bigIntValue = new BigInteger(subStr, 16);
+ } else {
+ bigIntValue = new BigInteger(judgedValue);
+ }
+ } else {
+ bigIntValue = new BigInteger(judgedValue);
+ }
+ if (bigIntValue.bitCount() == 0) {
return true;
}
break;