summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2021-04-20 10:28:12 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-04-23 18:55:51 +0000
commitf2f4c6be2dba3f8e97ac544b9c3da71e9f81b294 (patch)
tree3be74d904cc6c45ead054c929fbc268627105c40 /BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
parent61680cac5e435053be89a4fc6b945466f2c7bac6 (diff)
downloadedk2-f2f4c6be2dba3f8e97ac544b9c3da71e9f81b294.tar.gz
edk2-f2f4c6be2dba3f8e97ac544b9c3da71e9f81b294.tar.bz2
edk2-f2f4c6be2dba3f8e97ac544b9c3da71e9f81b294.zip
BaseTools/Source/Python: Verify TAB_TOD_DEFINES_FAMILY key present
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3344 Veify that TAB_TOD_DEFINES_FAMILY key is present in ToolDef dictionary before access. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/PlatformAutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/PlatformAutoGen.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
index c16f2e4cd8..e2ef325677 100644
--- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
@@ -1474,8 +1474,11 @@ class PlatformAutoGen(AutoGen):
if ToolDef[Tool].get(TAB_TOD_DEFINES_BUILDRULEFAMILY, "") != "":
if Family != ToolDef[Tool][TAB_TOD_DEFINES_BUILDRULEFAMILY]:
continue
- elif Family != ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]:
- continue
+ else:
+ if ToolDef[Tool].get(TAB_TOD_DEFINES_FAMILY, "") == "":
+ continue
+ if Family != ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]:
+ continue
FamilyMatch = True
# expand any wildcard
if Target == TAB_STAR or Target == self.BuildTarget:
@@ -1509,6 +1512,8 @@ class PlatformAutoGen(AutoGen):
if Tool not in ToolDef or Family == "":
continue
# option has been added before
+ if TAB_TOD_DEFINES_FAMILY not in ToolDef[Tool]:
+ continue
if Family != ToolDef[Tool][TAB_TOD_DEFINES_FAMILY]:
continue