From nobody Thu May 9 02:19:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68981+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68981+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1608138504; cv=none; d=zohomail.com; s=zohoarc; b=NtRWA/tGqFdgaK3c19ZPRF1Ab+NCdulBVvl4kdqeJGXsnsx8KrAAZ+BZzQI+4BWBq49+FXcTWUyIql1Qyf2/VShJ0j78KDitPpN0osRGUBJ/WcXdE0lIHuobGfYUkC1A777pI09ZFi3gHJM0pqNlB0us5PZelwSz5deKrsxQCoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608138504; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=YX8/Vkdv/jpLGbYUHMNES8K4zyLu4u1dyXxftOMtN1g=; b=VAkgePsgFywySyvKMHOA0ZRalJXXr/q+cklzGUrIluz9M1sd6pVBo5/GOxj+ZneaulW4FwwCxMNt8kK0gKlFFlynePiT2mSBaYZp3qxAoI1h1+wOgVVBy0QJerg+xK+NdatNXx+sbfd7JD6BnjgfPFEEq2bIRo8iJGfILhTRPyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68981+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608138504696952.0839238903911; Wed, 16 Dec 2020 09:08:24 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 43kZYY1788612xiI636r7R7L; Wed, 16 Dec 2020 09:08:22 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.11536.1608138321960796508 for ; Wed, 16 Dec 2020 09:05:22 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DBAFD6E; Wed, 16 Dec 2020 09:05:21 -0800 (PST) X-Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2F5143F66E; Wed, 16 Dec 2020 09:05:19 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com Cc: sami.mujawar@arm.com Subject: [edk2-devel] [PATCH v1 1/2] BaseTools: Fix crash in ECC when parsing incorrect header Date: Wed, 16 Dec 2020 17:05:05 +0000 Message-Id: <20201216170506.13313-2-Pierre.Gondois@arm.com> In-Reply-To: <20201216170506.13313-1-Pierre.Gondois@arm.com> References: <20201216170506.13313-1-Pierre.Gondois@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: Tbm37nJb5cHIGBGzEPHsMYq9x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608138502; bh=BxCiRla4St3TQge9Ba/Ve5hO271PD1M+U03T5F2tiiY=; h=Cc:Date:From:Reply-To:Subject:To; b=DQYGfV2qsQRPRERdtYbFoW5k4UCUzJ6bpP2rXicvHJnsihW5FZuQ73fyYKLG/E1Yzs+ 9ffO2GfH2IvPjpm+H0llagTIQj3splAkF++VZlMChRp3bqIgdC55IGMVNs7t2fEnfL+E4 4Xe0HipY/7Unbe+IK8HBeRrM2/3Jc7MYcUI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sami Mujawar The ECC tool crashes if a C file has an incorrect file header format. The file ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuPeiLibConstructor.c has a file header in the incorrect format. It uses # to mark the header comments instead of enclosing the file header in /* */. This may have been a result of an INF file header being copied to a C file. A separate patch fixes the C file but ECC tool should not crash if a file with an incorrect header is found. Therefore, update the ECC tool to prevent it from crashing if an incorrect file header is found. With this change the ECC tool will report the incorrect header issue without crashing. Signed-off-by: Sami Mujawar --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1551_= Ecc_BaseTools_v1 BaseTools/Source/Python/Ecc/c.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index a30122a45f81..db686df0db25 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -2,6 +2,7 @@ # This file is used to be the c coding style checking of ECC tool # # Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -64,7 +65,9 @@ def GetIdType(Str): Type =3D DataClass.MODEL_UNKNOWN Str =3D Str.replace('#', '# ') List =3D Str.split() - if List[1] =3D=3D 'include': + if len(List) < 2: + pass + elif List[1] =3D=3D 'include': Type =3D DataClass.MODEL_IDENTIFIER_INCLUDE elif List[1] =3D=3D 'define': Type =3D DataClass.MODEL_IDENTIFIER_MACRO_DEFINE -- 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68981): https://edk2.groups.io/g/devel/message/68981 Mute This Topic: https://groups.io/mt/79005705/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 02:19:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68982+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68982+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1608138506; cv=none; d=zohomail.com; s=zohoarc; b=BTUoct/Qs12eqAS3ELVoLpQIF6+qqDv6JYODWQ9squi8X7HxJFKblIHXCZcQJnwQ4ZnyxWRAkklx9VUgw3q46ttHWBOzX6Cdkx1YAKM+Q2TBQOxQOKEnirND7Fiku2MQuYdvVP//kArix1GzAStmr1c9yWdCWqLSAxUeceRkSHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608138506; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=UvyJ1fOBRLKiIRm9+BJV2GuWv3GOcteE1ZFwdNWF/s0=; b=lji4zRtPNrAHRc88uulawClI6pB/ONIiggSVxTIoIWAL6/FWIcqNeiSic4dxOJiUgo3n9ZAkvolBGBpQb2r/X0yjeQdHIS/JN9M0sQgJEikQgDEq1tp/Xh9SpZa8EoFWRNkfFZOldYn0EtxNrDA8WSL8VPbGA0E8uzlzW44MshE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68982+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608138506751400.6151602827323; Wed, 16 Dec 2020 09:08:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HhfdYY1788612xYTrP4NUGlA; Wed, 16 Dec 2020 09:08:24 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.11478.1608138323851420699 for ; Wed, 16 Dec 2020 09:05:23 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 768E01042; Wed, 16 Dec 2020 09:05:23 -0800 (PST) X-Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 08CE03F66E; Wed, 16 Dec 2020 09:05:21 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com Cc: sami.mujawar@arm.com Subject: [edk2-devel] [PATCH v1 2/2] BaseTools/Ecc: Allow init of function static variables Date: Wed, 16 Dec 2020 17:05:06 +0000 Message-Id: <20201216170506.13313-3-Pierre.Gondois@arm.com> In-Reply-To: <20201216170506.13313-1-Pierre.Gondois@arm.com> References: <20201216170506.13313-1-Pierre.Gondois@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: uPSpjcbM9NAbAyYz287htWnvx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608138504; bh=KbLVXRoqhRa3zq+vYygtnFAevDMMUWVkyD64UcjHVLQ=; h=Cc:Date:From:Reply-To:Subject:To; b=H9u6vNROjYmTiYSkaomr1M5smXjlqLg94lNTM+Cgm7yMYnznakHmvQsOPgbkBefiw2o ZogORRtbcBt9PbswEhVcREFQZr0iuidfvsDDiBuLGD6uaF29me8fjmU06leCD6rOaYB+H cqZfg5rSnw3Oiylog3y+iM4DgZwoLWqtujU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The Ecc tool currently reports the initialization of variables at declaraton if the variable is non-constant and declared in a function. Static variables locally defined in functions should also be allowed to be initialized at declaration. Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1551_= Ecc_BaseTools_v1 BaseTools/Source/Python/Ecc/c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index db686df0db25..4a82e5e76003 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -1560,7 +1560,7 @@ def CheckFuncLayoutLocalVariable(FullFileName): continue for Result in ResultSet: - if len(Result[1]) > 0 and 'CONST' not in Result[3]: + if len(Result[1]) > 0 and 'CONST' not in Result[3] and 'STATIC= ' not in Result[3]: PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VAR= IABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2]) def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId): -- 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68982): https://edk2.groups.io/g/devel/message/68982 Mute This Topic: https://groups.io/mt/79005708/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-