From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B01CE21BBC421 for ; Thu, 22 Jun 2017 23:51:23 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2017 23:52:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,376,1493708400"; d="scan'208";a="984309500" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 22 Jun 2017 23:52:48 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Jun 2017 23:52:48 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Jun 2017 23:52:48 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.122]) with mapi id 14.03.0319.002; Fri, 23 Jun 2017 14:52:46 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: report error HiiString in HII format PCD must not be empty Thread-Index: AQHS6+weuAVD918PwU2+Nz+t67bA+KIyAsfA Date: Fri, 23 Jun 2017 06:52:46 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D74DDCA@shsmsx102.ccr.corp.intel.com> References: <1498200228-8628-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1498200228-8628-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: report error HiiString in HII format PCD must not be empty X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 06:51:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Friday, June 23, 2017 2:44 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [Patch] BaseTools: report error HiiString in HII format PCD must = not >be empty > >Add a check that HiiString field in the HII format PCD entry must not >be an empty string. > >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/Workspace/MetaFileParser.py | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py >b/BaseTools/Source/Python/Workspace/MetaFileParser.py >index d094403..4a5311a 100644 >--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py >+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py >@@ -1137,10 +1137,17 @@ class DscParser(MetaFileParser): > if len(ValueList) > 1 and ValueList[1] !=3D TAB_VOID \ > and self._ItemType in [MODEL_PCD_DYNAMIC_DE= FAULT, >MODEL_PCD_DYNAMIC_EX_DEFAULT]: > EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s= ' of >PCD is wrong" % ValueList[1], > ExtraData=3Dself._CurrentLine, File=3Dself.Me= taFile, >Line=3Dself._LineIndex + 1) > >+ # Validate the VariableName of DynamicHii and DynamicExHii for PC= D >Entry must not be an empty string >+ if self._ItemType in [MODEL_PCD_DYNAMIC_HII, >MODEL_PCD_DYNAMIC_EX_HII]: >+ DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE= _SPLIT, 1) >+ if len(DscPcdValueList[0].replace('L','').replace('"','').str= ip()) =3D=3D 0: >+ EdkLogger.error('Parser', FORMAT_INVALID, "The VariableNa= me >field in the HII format PCD entry must not be an empty string", >+ ExtraData=3Dself._CurrentLine, File=3Dself.Me= taFile, >Line=3Dself._LineIndex + 1) >+ > # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE= ', replace with >integer 1 or 0. > DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_SPL= IT, 1) > if DscPcdValueList[0] in ['True', 'true', 'TRUE']: > self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0= ], '1', 1); > elif DscPcdValueList[0] in ['False', 'false', 'FALSE']: >-- >2.6.1.windows.1