]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Fix a bug to get correct member variable
authorHess Chen <hesheng.chen@intel.com>
Thu, 2 Jul 2015 06:02:42 +0000 (06:02 +0000)
committerhchen30 <hchen30@Edk2>
Thu, 2 Jul 2015 06:02:42 +0000 (06:02 +0000)
Fix a bug to get correct member variable by ignoring 'OPTIONAL' modifier

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17800 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/Python/Ecc/c.py

index 997e631c97c195357eab18d4622ce9d0575732a3..1e89f117285ca506e510354f81e9f59418699f26 100644 (file)
@@ -1632,8 +1632,11 @@ def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
         Field = Field.split('=')[0].strip()\r
         TokenList = Field.split()\r
         # Remove pointers before variable\r
-        if not Pattern.match(TokenList[-1].lstrip('*')):\r
-            ErrMsgList.append(TokenList[-1].lstrip('*'))\r
+        Token = TokenList[-1]\r
+        if Token in ['OPTIONAL']:\r
+            Token = TokenList[-2]\r
+        if not Pattern.match(Token.lstrip('*')):\r
+            ErrMsgList.append(Token.lstrip('*'))\r
 \r
     return ErrMsgList\r
 \r