diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2015-06-23 07:02:03 +0000 |
---|---|---|
committer | yingke <yingke@Edk2> | 2015-06-23 07:02:03 +0000 |
commit | f827cd07d0967deb3cfa0bf3348e6687823fd489 (patch) | |
tree | 20b9ff83f4fc82a914c2e480d52cdf5241e93e27 /BaseTools/Source/Python | |
parent | 37fe82ee80c62bd8838ab22078e44f6269f812cc (diff) | |
download | edk2-platforms-f827cd07d0967deb3cfa0bf3348e6687823fd489.tar.xz |
BaseTools: The token values cannot be numeric same with different PCDs.
Current check only compared string format of toke value.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17682 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index ca7d5abb62..7fb1a8889a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -651,7 +651,7 @@ class WorkspaceAutoGen(AutoGen): for Pa in self.AutoGenObjectList:
for Package in Pa.PackageList:
PcdList = Package.Pcds.values()
- PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue))
+ PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0)))
Count = 0
while (Count < len(PcdList) - 1) :
Item = PcdList[Count]
@@ -659,13 +659,13 @@ class WorkspaceAutoGen(AutoGen): #
# Make sure in the same token space the TokenValue should be unique
#
- if (Item.TokenValue == ItemNext.TokenValue):
+ if (int(Item.TokenValue, 0) == int(ItemNext.TokenValue, 0)):
SameTokenValuePcdList = []
SameTokenValuePcdList.append(Item)
SameTokenValuePcdList.append(ItemNext)
RemainPcdListLength = len(PcdList) - Count - 2
for ValueSameCount in range(RemainPcdListLength):
- if PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue == Item.TokenValue:
+ if int(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue, 0) == int(Item.TokenValue, 0):
SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])
else:
break;
@@ -699,7 +699,7 @@ class WorkspaceAutoGen(AutoGen): #
# Check PCDs with same TokenSpaceGuidCName.TokenCName have same token value as well.
#
- if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (Item.TokenValue != ItemNext.TokenValue):
+ if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (int(Item.TokenValue, 0) != int(ItemNext.TokenValue, 0)):
EdkLogger.error(
'build',
FORMAT_INVALID,
|