]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/Tools/GenCfgOpt.py
IntelFsp2Pkg: Raise exception for invalid BSF option
[mirror_edk2.git] / 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