]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug for Hii Pcd override
authorBob Feng <bob.c.feng@intel.com>
Thu, 5 Sep 2019 09:45:10 +0000 (17:45 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Tue, 10 Sep 2019 00:39:16 +0000 (08:39 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2157

Hii Pcd links to a efi variable. The Variable
default value is evaluated by related Hii Pcds
setting. If multiple Hii Pcds links to one variable,
and the offset overlap, the later Hii Pcds setting
should be effective. There is a tool bug that is if
the Pcds are in different dsc file which are included
into the platform dsc file, build tool does not get
the Pcds relative position correctly. That means
build tool does not know which Pcd is the later one. As
the result, the variable default value will be incorrect.

This patch is to fix this bug.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/Workspace/DscBuildData.py

index d2b5ccbb7a304e3e9fce86eb32da7f0222e0dd17..9192077f90647ab7ffe8efbdf473ef30806709ab 100644 (file)
@@ -3014,7 +3014,7 @@ class DscBuildData(PlatformBuildClassObject):
 \r
 \r
         # Remove redundant PCD candidates, per the ARCH and SKU\r
-        for PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4 in PcdList:\r
+        for index,(PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4) in enumerate(PcdList):\r
 \r
             Setting = PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore]\r
             if Setting is None:\r
@@ -3083,7 +3083,7 @@ class DscBuildData(PlatformBuildClassObject):
                     PcdClassObj.UserDefinedDefaultStoresFlag = True\r
                 Pcds[PcdCName, TokenSpaceGuid] = PcdClassObj\r
 \r
-                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = int(Dummy4)\r
+                Pcds[PcdCName, TokenSpaceGuid].CustomAttribute['DscPosition'] = index\r
             if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:\r
                 Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = {}\r
                 Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = {}\r