summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-19 09:13:44 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-19 09:13:44 +0000
commite59cdca8e82ca1165c4885f52666ae7b81140f75 (patch)
treeded9dccc51f0c22c3e56354cb10b8446205f27c2 /Tools
parentbab72a575b06bfc7679389b45e3424053ac0f3ac (diff)
downloadedk2-platforms-e59cdca8e82ca1165c4885f52666ae7b81140f75.tar.xz
Fix a bug to judege max value of UINT32, 0xFFFFFFFF is invalid UINT32 in JAVA.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@560 6f19259b-4bc3-4df7-8a09-765794883524
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;