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>
return MacroDict\r
\r
def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):\r
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
MacroPcdDict = self.__CollectMacroPcd()\r
if Op == 'eval':\r
try:\r
" 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
" 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
else:\r
raise Warning("PCD (%s) is not defined in DSC file (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']),\r
else:\r
raise Warning("PCD (%s) is not defined in DSC file (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']),\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
else:\r
if Expression.startswith('$(') and Expression[-1] == ')':\r
Expression = Expression[2:-1] \r