]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
Fix a bug to judege max value of UINT32, 0xFFFFFFFF is invalid UINT32 in JAVA.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / entity / Token.java
index d90133636665e72b99aa9ad50714185e449db741..9a54a3e579bb14ac8240463baa8bc252a800e834 100644 (file)
@@ -593,14 +593,25 @@ public class Token {
 \r
     public boolean isValidNullValue(String judgedValue) {\r
         int         intValue;\r
+        String      subStr;\r
         BigInteger  bigIntValue;\r
 \r
         switch (datumType) {\r
         case UINT8:\r
         case UINT16:\r
         case UINT32:\r
-            intValue = Integer.decode(judgedValue);\r
-            if (intValue == 0) {\r
+            if (judgedValue.length() > 2) {\r
+                if ((judgedValue.charAt(0) == '0')        && \r
+                    ((judgedValue.charAt(1) == 'x') || (judgedValue.charAt(1) == 'X'))){\r
+                    subStr      = judgedValue.substring(2, judgedValue.length());\r
+                    bigIntValue = new BigInteger(subStr, 16);\r
+                } else {\r
+                    bigIntValue = new BigInteger(judgedValue);\r
+                }\r
+            } else {\r
+                bigIntValue = new BigInteger(judgedValue);\r
+            }\r
+            if (bigIntValue.bitCount() == 0) {\r
                 return true;\r
             }\r
             break;\r