summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2015-07-02 06:02:42 +0000
committerhchen30 <hchen30@Edk2>2015-07-02 06:02:42 +0000
commitfa3a21569b05693f414ed39e3acd74e3e58b299c (patch)
treefe2434ffb849410e56eaa07e1370f0f1cf32a231 /BaseTools/Source/Python
parentfa4470638a4f6ef32bb5eb91ed06c4e7471b8247 (diff)
downloadedk2-platforms-fa3a21569b05693f414ed39e3acd74e3e58b299c.tar.xz
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 <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
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/Ecc/c.py7
1 files 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