From 46e4b3940e2f1862aa605900616a543a43f17222 Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Fri, 8 Jun 2018 16:46:48 +0800 Subject: [PATCH] BaseTools: Fix one bug of nest !include parser The case is DSC file include file1, file1 include file2, after parse file2 finished, DSC parser get the wrong section type, then it would report invalid error. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu Tested-by: Michael D Kinney --- BaseTools/Source/Python/Workspace/MetaFileParser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index b1e715d5d4..a2ded0c845 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1581,7 +1581,11 @@ class DscParser(MetaFileParser): # update current status with sub-parser's status self._SectionName = Parser._SectionName - self._SectionType = Parser._SectionType + if not self._InSubsection: + self._SectionType = Parser._SectionType + self._SubsectionType = Parser._SubsectionType + self._InSubsection = Parser._InSubsection + self._Scope = Parser._Scope self._Enabled = Parser._Enabled -- 2.39.2