From e59cdca8e82ca1165c4885f52666ae7b81140f75 Mon Sep 17 00:00:00 2001 From: klu2 Date: Mon, 19 Jun 2006 09:13:44 +0000 Subject: [PATCH] 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 --- .../org/tianocore/build/pcd/entity/Token.java | 15 +++++++++++++-- 1 file 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; -- 2.39.2