diff options
author | Zurcher, Christopher J <christopher.j.zurcher@intel.com> | 2018-05-23 11:35:42 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-28 09:20:24 +0800 |
commit | 20274d2389eb012812f4561c8eb7cffc57a68850 (patch) | |
tree | 298b0b7843412bc70b065aa283a34d21068df46f /BaseTools/Source/Python/GenFds/FdfParser.py | |
parent | e95a0dfb46339d459add8af848d5042ec6ff9a8d (diff) | |
download | edk2-20274d2389eb012812f4561c8eb7cffc57a68850.tar.gz edk2-20274d2389eb012812f4561c8eb7cffc57a68850.tar.bz2 edk2-20274d2389eb012812f4561c8eb7cffc57a68850.zip |
BaseTools/GenFds: Remove redundant GetRealFileLine call
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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 8a9296c49d..4518d8f2af 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -914,7 +914,6 @@ class FdfParser: return MacroDict
def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):
- FileLineTuple = GetRealFileLine(self.FileName, Line)
MacroPcdDict = self.__CollectMacroPcd()
if Op == 'eval':
try:
@@ -939,12 +938,12 @@ class FdfParser: " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
" of the DSC file (%s), and it is currently defined in this section:"
" %s, line #: %d." % (Excpt.Pcd, GlobalData.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] == ')':
Expression = Expression[2:-1]
|