From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 61F15803A4 for ; Wed, 15 Mar 2017 02:24:45 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 15 Mar 2017 02:24:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,168,1486454400"; d="scan'208";a="1108661016" Received: from unknown (HELO RTHOMAIY-DESK3.gar.corp.intel.com) ([10.223.165.169]) by orsmga001.jf.intel.com with ESMTP; 15 Mar 2017 02:24:43 -0700 From: rthomaiy To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Richard Thomaiyar Date: Wed, 15 Mar 2017 14:54:23 +0530 Message-Id: <20170315092423.13840-1-richard.marian.thomaiyar@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [PATCH] IntelFsp2Pkg: Raise exception for invalid BSF option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2017 09:24:45 -0000 Raise exception for invalid BSF option in GenCfgOpt.py Cc: Maurice Ma Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Richard Thomaiyar --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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.
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
# 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 -- 2.9.0.windows.1