Fix a bug in parsing <pcdsdynamic> of <components> of <dsc>
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 13 Aug 2007 07:24:07 +0000 (07:24 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 13 Aug 2007 07:24:07 +0000 (07:24 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@555 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/DscClassObject.py

index ef342ec..1b6b492 100644 (file)
@@ -297,17 +297,18 @@ class Dsc(DscObject):
                         else:\r
                             Component.PcdBuildDefinitions.append(PcdClass(List[0], '', List[1], '', '', List[2], Type, [], {}, []))\r
                     if Type == DataType.TAB_PCDS_FIXED_AT_BUILD or Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:\r
-                        if len(List.append('')) < 4:\r
+                        List.append('')\r
+                        if len(List) < 4:\r
                             ErrorMsg = "Wrong Pcds%s statement '%s' found in section Components in file '%s', correct format is '<Cname>|<TokenSpaceGuidCName>|<Value>[|<MaxDatumSize>]'" % (Type, Pcd[1], self.Platform.Header.FullPath) \r
                             raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
                         else:\r
                             Component.PcdBuildDefinitions.append(PcdClass(List[0], '', List[1], '', List[3], List[2], Type, [], {}, []))\r
                     if Type == DataType.TAB_PCDS_DYNAMIC or Type == DataType.TAB_PCDS_DYNAMIC_EX:\r
-                        if len(List) != 2:\r
-                            ErrorMsg = "Wrong Pcds%s statement '%s' found in section Components in file '%s', correct format is '<Cname>|<TokenSpaceGuidCName>|<Value>[|<MaxDatumSize>]'" % (Type, Pcd[1], self.Platform.Header.FullPath) \r
+                        if len(List) != 3:\r
+                            ErrorMsg = "Wrong Pcds%s statement '%s' found in section Components in file '%s', correct format is '<Cname>|<TokenSpaceGuidCName>'" % (Type, Pcd[1], self.Platform.Header.FullPath) \r
                             raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
                         else:\r
-                            Component.PcdBuildDefinitions.append(PcdClass(List[0], '', List[1], '', List[3], List[2], Type, [], {}, []))                        \r
+                            Component.PcdBuildDefinitions.append(PcdClass(List[0], '', List[1], '', '', List[2], Type, [], {}, []))                        \r
                     \r
                 if GenInclude(Item[0], IncludeFiles, Arch):\r
                     continue\r