From nobody Sun May 5 03:35:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1527206368845351.76978802978056; Thu, 24 May 2018 16:59:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 65F9520961833; Thu, 24 May 2018 16:59:27 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 8B39E207E4DE4 for ; Thu, 24 May 2018 16:59:25 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 May 2018 16:59:24 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga004.fm.intel.com with ESMTP; 24 May 2018 16:59:23 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,437,1520924400"; d="scan'208";a="57397009" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 25 May 2018 07:59:23 +0800 Message-Id: <1527206363-10064-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools/GenFds: Remove redundant GetRealFileLine call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zurcher@ml01.01.org, Christopher J , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Zurcher, Christopher J The EvaluateConditional function should not call GetRealFileLine because this is already done in Warning init and only needs to be calculated in the event of a parsing failure. This fix stops InsertedLines from being subtracted twice during error handling. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zurcher, Christopher J Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenFds/FdfParser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 8a9296c..4518d8f 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -912,11 +912,10 @@ class FdfParser: # Highest priority =20 return MacroDict =20 def __EvaluateConditional(self, Expression, Line, Op =3D None, Value = =3D None): - FileLineTuple =3D GetRealFileLine(self.FileName, Line) MacroPcdDict =3D self.__CollectMacroPcd() if Op =3D=3D 'eval': try: if Value: return ValueExpression(Expression, MacroPcdDict)(True) @@ -937,16 +936,16 @@ class FdfParser: Info =3D GlobalData.gPlatformOtherPcds[Excpt.Pcd] raise Warning("Cannot use this PCD (%s) in an expr= ession as" " it must be defined in a [PcdsFixed= AtBuild] or [PcdsFeatureFlag] section" " of the DSC file (%s), and it is cu= rrently defined in this section:" " %s, line #: %d." % (Excpt.Pcd, Glo= balData.gPlatformOtherPcds['DSCFILE'], Info[0], Info[1]), - *FileLineTuple) + self.FileName, Line) else: raise Warning("PCD (%s) is not defined in DSC file= (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']), - *FileLineTuple) + self.FileName, Line) else: - raise Warning(str(Excpt), *FileLineTuple) + raise Warning(str(Excpt), self.FileName, Line) else: if Expression.startswith('$(') and Expression[-1] =3D=3D ')': Expression =3D Expression[2:-1] =20 return Expression in MacroPcdDict =20 --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel