From nobody Tue Jan 14 22:33:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513654197510434.94944770703194; Mon, 18 Dec 2017 19:29:57 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0ECAE221C1930; Mon, 18 Dec 2017 19:24:53 -0800 (PST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 9D922221C1926 for ; Mon, 18 Dec 2017 19:24:50 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2017 19:29:36 -0800 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.10]) by fmsmga006.fm.intel.com with ESMTP; 18 Dec 2017 19:29:35 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,424,1508828400"; d="scan'208";a="188196748" From: Hao Wu To: edk2-devel@lists.01.org Date: Tue, 19 Dec 2017 11:29:09 +0800 Message-Id: <20171219032912.14404-15-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20171219032912.14404-1-hao.a.wu@intel.com> References: <20171219032912.14404-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 14/17] BaseTools/VfrCompile: Resolve uninit class variables in constructor 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: , Cc: Hao Wu , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The commit initializes those possibly uninitialized class variables in class constructors. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- BaseTools/Source/C/VfrCompile/VfrError.cpp | 1 + BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 6 ++++++ BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/BaseTools/Source/C/VfrCompile/VfrError.cpp b/BaseTools/Source/= C/VfrCompile/VfrError.cpp index 0f8f7dd891..2366fac5a7 100644 --- a/BaseTools/Source/C/VfrCompile/VfrError.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrError.cpp @@ -67,6 +67,7 @@ CVfrErrorHandle::CVfrErrorHandle ( mScopeRecordListTail =3D NULL; mVfrErrorHandleTable =3D VFR_ERROR_HANDLE_TABLE; mVfrWarningHandleTable =3D VFR_WARNING_HANDLE_TABLE; + mWarningAsError =3D FALSE; } =20 CVfrErrorHandle::~CVfrErrorHandle ( diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Sourc= e/C/VfrCompile/VfrFormPkg.cpp index b8350623f2..0f0efd4c6d 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp @@ -104,8 +104,13 @@ CFormPkg::CFormPkg ( SBufferNode *Node; =20 mPkgLength =3D 0; + mBufferSize =3D 0; mBufferNodeQueueHead =3D NULL; + mBufferNodeQueueTail =3D NULL; mCurrBufferNode =3D NULL; + mReadBufferNode =3D NULL; + mReadBufferOffset =3D 0; + PendingAssignList =3D NULL; =20 Node =3D new SBufferNode; if (Node =3D=3D NULL) { @@ -2421,6 +2426,7 @@ CIfrObj::CIfrObj ( mObjBinLen =3D (ObjBinLen =3D=3D 0) ? gOpcodeSizesScopeTable[OpCode].m= Size : ObjBinLen; mObjBinBuf =3D ((DelayEmit =3D=3D FALSE) && (gCreateOp =3D=3D TRUE)) ?= gCFormPkg.IfrBinBufferGet (mObjBinLen) : new CHAR8[EFI_IFR_MAX_LENGTH]; mRecordIdx =3D (gCreateOp =3D=3D TRUE) ? gCIfrRecordInfoDB.IfrRecordRe= gister (0xFFFFFFFF, mObjBinBuf, mObjBinLen, mPkgOffset) : EFI_IFR_RECORDINF= O_IDX_INVALUD; + mLineNo =3D 0; =20 assert (mObjBinBuf !=3D NULL); =20 diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/So= urce/C/VfrCompile/VfrUtilityLib.cpp index 4866639aab..c536498d77 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -958,6 +958,7 @@ CVfrVarDataTypeDB::CVfrVarDataTypeDB ( mPackAlign =3D DEFAULT_PACK_ALIGN; mPackStack =3D NULL; mFirstNewDataTypeName =3D NULL; + mCurrDataType =3D NULL; =20 InternalTypesListInit (); } @@ -1605,6 +1606,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( IN EFI_VARSTORE_ID VarStoreId ) { + memset (&mGuid, 0, sizeof (EFI_GUID)); if (StoreName !=3D NULL) { mVarStoreName =3D new CHAR8[strlen(StoreName) + 1]; strcpy (mVarStoreName, StoreName); @@ -1616,6 +1618,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( mVarStoreType =3D EFI_VFR_VARSTORE_NAME; mStorageInfo.mNameSpace.mNameTable =3D new EFI_VARSTORE_ID[DEFAULT_NAME_= TABLE_ITEMS]; mStorageInfo.mNameSpace.mTableSize =3D 0; + mAssignedFlag =3D FALSE; } =20 SVfrVarStorageNode::~SVfrVarStorageNode ( --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel