diff options
| author | PaddyDeng <paddydeng@ami.com> | 2026-01-19 06:26:25 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-01-30 12:55:39 +0300 |
| commit | c2915d24a1832138b5f680b31612bf6198adfb5f (patch) | |
| tree | 9917d950865ed104d5cfeb43d8cbf17b20e9730b /BaseTools/Source/Python/Workspace/MetaFileParser.py | |
| parent | 1a261da766ef14f6dea157d4a5362e84a755023f (diff) | |
| download | edk2-c2915d24a1832138b5f680b31612bf6198adfb5f.tar.xz | |
BaseTools: Prevent Subsection PCDs from polluting global expressions
The PCD value defined in module subsections can be added to global PCD
database. Therefore the unsolved expressions, even belongs to the global
scope, can incorrectly refer to the value from module subsection.
This only happens when the referred PCD has no value assignment in the
platform dsc file. Which also should raise an error.
Signed-off-by: Paddy Deng <paddydeng@ami.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
| -rw-r--r-- | BaseTools/Source/Python/Workspace/MetaFileParser.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 5d2a44481d..512b172352 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1702,8 +1702,9 @@ class DscParser(MetaFileParser): ValList[Index] = '0'
if (not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack):
- GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
- self._Symbols[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
+ if not self._InSubsection:
+ GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
+ self._Symbols[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
try:
self._ValueList[2] = '|'.join(ValList)
except Exception:
|
