]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFsp2Pkg: Raise exception for invalid BSF option
authorThomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com>
Wed, 15 Mar 2017 09:24:23 +0000 (17:24 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Thu, 16 Mar 2017 14:07:04 +0000 (22:07 +0800)
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>
IntelFsp2Pkg/Tools/GenCfgOpt.py

index d8038e98ce9e0f354f9aec114ccbdecb7ecf392b..6dc1b10b34697c7b7fb490135c6cf9c767b0c628 100644 (file)
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py\r
 #\r
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License that accompanies this distribution.\r
 # The full text of the license may be found at\r
@@ -1239,6 +1239,7 @@ EndList
         return 0\r
 \r
     def WriteBsfStruct  (self, BsfFd, Item):\r
+        LogExpr = CLogicalExpression()\r
         if Item['type'] == "None":\r
             Space = "gPlatformFspPkgTokenSpaceGuid"\r
         else:\r
@@ -1260,6 +1261,9 @@ EndList
                 for Option in OptList:\r
                     Option = Option.strip()\r
                     (OpVal, OpStr) = Option.split(':')\r
+                    test = LogExpr.getNumber (OpVal)\r
+                    if test is None:\r
+                        raise Exception("Selection Index '%s' is not a number" % OpVal)\r
                     TmpList.append((OpVal, OpStr))\r
         return  TmpList\r
 \r