]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: INF should use latest Pcd value instead of default value
authorLi, Yi1 <yi1.li@intel.com>
Mon, 11 Jul 2022 05:48:14 +0000 (13:48 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 24 Jul 2022 06:46:33 +0000 (06:46 +0000)
This patch is a bug fix about FeatureFlagExpression in INF file:
 INF [Source] section now unconditionally use Pcd default value in DEC
 when handling FeatureFlagExpression, it is wrong.
 If a Pcd value has been set in the DSC file, we should use latest
 value in DSC instead of default value.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Workspace/InfBuildData.py

index 5b9b3d7b4f014ea2f7277d7a5b7f44cec66a1f34..e4ff1c6686669b4789d236fd11245139c879a5e4 100644 (file)
@@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject):
         else:\r
             for Name, Guid in self.Pcds:\r
                 if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':\r
-                    Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name, Guid)].DefaultValue\r
+                    PcdFullName = '%s.%s' % (Guid, Name);\r
+                    if not PcdFullName in Pcds:\r
+                        Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue\r
             try:\r
                 Value = ValueExpression(Instance, Pcds)()\r
                 if Value == True:\r