]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: The token values cannot be numeric same with different PCDs.
authorYingke Liu <yingke.d.liu@intel.com>
Tue, 23 Jun 2015 07:02:03 +0000 (07:02 +0000)
committeryingke <yingke@Edk2>
Tue, 23 Jun 2015 07:02:03 +0000 (07:02 +0000)
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

BaseTools/Source/Python/AutoGen/AutoGen.py

index ca7d5abb623efe4301fdfdde77af0d0f67febf6b..7fb1a8889aa659e88effb5f80dbe6470157dfc5b 100644 (file)
@@ -651,7 +651,7 @@ class WorkspaceAutoGen(AutoGen):
         for Pa in self.AutoGenObjectList:\r
             for Package in Pa.PackageList:\r
                 PcdList = Package.Pcds.values()\r
-                PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue)) \r
+                PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0))) \r
                 Count = 0\r
                 while (Count < len(PcdList) - 1) :\r
                     Item = PcdList[Count]\r
@@ -659,13 +659,13 @@ class WorkspaceAutoGen(AutoGen):
                     #\r
                     # Make sure in the same token space the TokenValue should be unique\r
                     #\r
-                    if (Item.TokenValue == ItemNext.TokenValue):\r
+                    if (int(Item.TokenValue, 0) == int(ItemNext.TokenValue, 0)):\r
                         SameTokenValuePcdList = []\r
                         SameTokenValuePcdList.append(Item)\r
                         SameTokenValuePcdList.append(ItemNext)\r
                         RemainPcdListLength = len(PcdList) - Count - 2\r
                         for ValueSameCount in range(RemainPcdListLength):\r
-                            if PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue == Item.TokenValue:\r
+                            if int(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue, 0) == int(Item.TokenValue, 0):\r
                                 SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])\r
                             else:\r
                                 break;\r
@@ -699,7 +699,7 @@ class WorkspaceAutoGen(AutoGen):
                     #\r
                     # Check PCDs with same TokenSpaceGuidCName.TokenCName have same token value as well.\r
                     #\r
-                    if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (Item.TokenValue != ItemNext.TokenValue):\r
+                    if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (int(Item.TokenValue, 0) != int(ItemNext.TokenValue, 0)):\r
                         EdkLogger.error(\r
                                     'build',\r
                                     FORMAT_INVALID,\r