public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix one bug of nest !include parser
@ 2018-06-12  1:00 Yonghong Zhu
  2018-06-12  1:51 ` Kinney, Michael D
  2018-06-13  1:00 ` Zhu, Yonghong
  0 siblings, 2 replies; 3+ messages in thread
From: Yonghong Zhu @ 2018-06-12  1:00 UTC (permalink / raw)
  To: edk2-devel; +Cc: Yunhua Feng, Liming Gao

From: Yunhua Feng <yunhuax.feng@intel.com>

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 <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 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 8ab1dd2..4252e6d 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1568,11 +1568,15 @@ class DscParser(MetaFileParser):
             # Parse the included file
             Parser.Start()
 
             # 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
 
             # Insert all records in the table for the included file into dsc file table
             Records = IncludedFileTable.GetAll()
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-13  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-12  1:00 [Patch] BaseTools: Fix one bug of nest !include parser Yonghong Zhu
2018-06-12  1:51 ` Kinney, Michael D
2018-06-13  1:00 ` Zhu, Yonghong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox