From: Hess Chen Date: Thu, 2 Jul 2015 06:02:42 +0000 (+0000) Subject: BaseTools/Ecc: Fix a bug to get correct member variable X-Git-Tag: edk2-stable201903~9474 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=fa3a21569b05693f414ed39e3acd74e3e58b299c BaseTools/Ecc: Fix a bug to get correct member variable Fix a bug to get correct member variable by ignoring 'OPTIONAL' modifier Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen Reviewed-by: YangX Li git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17800 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py index 997e631c97..1e89f11728 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -1632,8 +1632,11 @@ def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId): Field = Field.split('=')[0].strip() TokenList = Field.split() # Remove pointers before variable - if not Pattern.match(TokenList[-1].lstrip('*')): - ErrMsgList.append(TokenList[-1].lstrip('*')) + Token = TokenList[-1] + if Token in ['OPTIONAL']: + Token = TokenList[-2] + if not Pattern.match(Token.lstrip('*')): + ErrMsgList.append(Token.lstrip('*')) return ErrMsgList