]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix one bug of nest !include parser
authorYunhua Feng <yunhuax.feng@intel.com>
Fri, 8 Jun 2018 08:46:48 +0000 (16:46 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 13 Jun 2018 01:01:32 +0000 (09:01 +0800)
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>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
BaseTools/Source/Python/Workspace/MetaFileParser.py

index b1e715d5d4a9975944c7aef94c89dab6419060d4..a2ded0c845ae49bfd6e880ffc42c549592df29f7 100644 (file)
@@ -1581,7 +1581,11 @@ class DscParser(MetaFileParser):
 \r
             # update current status with sub-parser's status\r
             self._SectionName = Parser._SectionName\r
 \r
             # update current status with sub-parser's status\r
             self._SectionName = Parser._SectionName\r
-            self._SectionType = Parser._SectionType\r
+            if not self._InSubsection:\r
+                self._SectionType = Parser._SectionType\r
+            self._SubsectionType = Parser._SubsectionType\r
+            self._InSubsection = Parser._InSubsection\r
+\r
             self._Scope = Parser._Scope\r
             self._Enabled = Parser._Enabled\r
 \r
             self._Scope = Parser._Scope\r
             self._Enabled = Parser._Enabled\r
 \r