public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: enhance error check for DatumType format
Date: Tue, 6 Feb 2018 05:34:27 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1C7D91@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1517559830-2432-1-git-send-email-yonghong.zhu@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Friday, February 02, 2018 4:24 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: enhance error check for DatumType format
>
>Add a check for DatumType format, eg: VOID *, original Tool will crash
>but no detail error message which cause confusion to user.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/Workspace/DecBuildData.py | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py
>b/BaseTools/Source/Python/Workspace/DecBuildData.py
>index 2fd3820..2266b0b 100644
>--- a/BaseTools/Source/Python/Workspace/DecBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DecBuildData.py
>@@ -1,9 +1,9 @@
> ## @file
> # This file is used to create a database used by build tool
> #
>-# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
>+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
> # (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> # This program and the accompanying materials
> # are licensed and made available under the terms and conditions of the BSD
>License
> # which accompanies this distribution.  The full text of the license may be
>found at
> # http://opensource.org/licenses/bsd-license.php
>@@ -421,10 +421,15 @@ class DecBuildData(PackageBuildClassObject):
>             Setting,LineNo = PcdDict[self._Arch, PcdCName, TokenSpaceGuid]
>             if Setting == None:
>                 continue
>
>             DefaultValue, DatumType, TokenNumber = AnalyzePcdData(Setting)
>+            if DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32,
>TAB_UINT64, TAB_VOID, "BOOLEAN"]:
>+                StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')
>+                if StructPattern.match(DatumType) == None:
>+                    EdkLogger.error('build', FORMAT_INVALID, "DatumType only
>support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct
>name.", File=self.MetaFile, Line=LineNo)
>+
>             validateranges, validlists, expressions =
>self._RawData.GetValidExpression(TokenSpaceGuid, PcdCName)
>             PcdObj = PcdClassObject(
>                                         PcdCName,
>                                         TokenSpaceGuid,
>                                         self._PCD_TYPE_STRING_[Type],
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-02-06  5:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  8:23 [Patch] BaseTools: enhance error check for DatumType format Yonghong Zhu
2018-02-06  5:34 ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E1C7D91@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox