diff options
author | Thomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com> | 2017-03-15 17:24:23 +0800 |
---|---|---|
committer | Jiewen Yao <jiewen.yao@intel.com> | 2017-03-16 22:07:04 +0800 |
commit | ba8ea42738cf5caa8855c59da5359b8e7929568f (patch) | |
tree | 478899c42db88f3e999d006d3d792e30984ce026 /IntelFsp2Pkg | |
parent | 056563f1bbda839bab2ba32bd9bef962b862a9bd (diff) | |
download | edk2-ba8ea42738cf5caa8855c59da5359b8e7929568f.zip edk2-ba8ea42738cf5caa8855c59da5359b8e7929568f.tar.gz edk2-ba8ea42738cf5caa8855c59da5359b8e7929568f.tar.bz2 |
IntelFsp2Pkg: Raise exception for invalid BSF option
Raise exception for invalid BSF option in GenCfgOpt.py
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'IntelFsp2Pkg')
-rw-r--r-- | IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py index d8038e9..6dc1b10 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -1,6 +1,6 @@ ## @ GenCfgOpt.py
#
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
@@ -1239,6 +1239,7 @@ EndList return 0
def WriteBsfStruct (self, BsfFd, Item):
+ LogExpr = CLogicalExpression()
if Item['type'] == "None":
Space = "gPlatformFspPkgTokenSpaceGuid"
else:
@@ -1260,6 +1261,9 @@ EndList for Option in OptList:
Option = Option.strip()
(OpVal, OpStr) = Option.split(':')
+ test = LogExpr.getNumber (OpVal)
+ if test is None:
+ raise Exception("Selection Index '%s' is not a number" % OpVal)
TmpList.append((OpVal, OpStr))
return TmpList
|