]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/GenFds: Remove redundant GetRealFileLine call
authorZurcher, Christopher J <christopher.j.zurcher@intel.com>
Wed, 23 May 2018 03:35:42 +0000 (11:35 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 28 May 2018 01:20:24 +0000 (09:20 +0800)
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 <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zurcher, Christopher J <christopher.j.zurcher@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py

index 8a9296c49d1d1faeeaf09a4e61284e0206f72415..4518d8f2af7c5ae09350d82d04659b4486455225 100644 (file)
@@ -914,7 +914,6 @@ class FdfParser:
         return MacroDict\r
 \r
     def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):\r
-        FileLineTuple = GetRealFileLine(self.FileName, Line)\r
         MacroPcdDict = self.__CollectMacroPcd()\r
         if Op == 'eval':\r
             try:\r
@@ -939,12 +938,12 @@ class FdfParser:
                                       " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"\r
                                       " of the DSC file (%s), and it is currently defined in this section:"\r
                                       " %s, line #: %d." % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE'], Info[0], Info[1]),\r
-                                      *FileLineTuple)\r
+                                      self.FileName, Line)\r
                     else:\r
                         raise Warning("PCD (%s) is not defined in DSC file (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']),\r
-                                      *FileLineTuple)\r
+                                      self.FileName, Line)\r
                 else:\r
-                    raise Warning(str(Excpt), *FileLineTuple)\r
+                    raise Warning(str(Excpt), self.FileName, Line)\r
         else:\r
             if Expression.startswith('$(') and Expression[-1] == ')':\r
                 Expression = Expression[2:-1]            \r