From fa3a21569b05693f414ed39e3acd74e3e58b299c Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Thu, 2 Jul 2015 06:02:42 +0000 Subject: [PATCH] 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 --- BaseTools/Source/Python/Ecc/c.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.2