diff options
author | Hao Wu <hao.a.wu@intel.com> | 2017-12-18 10:11:57 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-12-25 09:54:41 +0800 |
commit | b748e35c2bb0b6bcd1d89ef67e8f905b0a1c5c11 (patch) | |
tree | 72be77d80c0b9ee6c195f900497ea0611f43bbbf /BaseTools | |
parent | d837f33ab00ce9a0708382bfcf8f48f39d287644 (diff) | |
download | edk2-b748e35c2bb0b6bcd1d89ef67e8f905b0a1c5c11.tar.gz edk2-b748e35c2bb0b6bcd1d89ef67e8f905b0a1c5c11.tar.bz2 edk2-b748e35c2bb0b6bcd1d89ef67e8f905b0a1c5c11.zip |
BaseTools/VfrCompile: Resolve uninit class variables in constructor
The commit initializes those possibly uninitialized class variables in
class constructors.
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrError.cpp | 1 | ||||
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 6 | ||||
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 3 |
3 files changed, 10 insertions, 0 deletions
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 = NULL;
mVfrErrorHandleTable = VFR_ERROR_HANDLE_TABLE;
mVfrWarningHandleTable = VFR_WARNING_HANDLE_TABLE;
+ mWarningAsError = FALSE;
}
CVfrErrorHandle::~CVfrErrorHandle (
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/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;
mPkgLength = 0;
+ mBufferSize = 0;
mBufferNodeQueueHead = NULL;
+ mBufferNodeQueueTail = NULL;
mCurrBufferNode = NULL;
+ mReadBufferNode = NULL;
+ mReadBufferOffset = 0;
+ PendingAssignList = NULL;
Node = new SBufferNode;
if (Node == NULL) {
@@ -2421,6 +2426,7 @@ CIfrObj::CIfrObj ( mObjBinLen = (ObjBinLen == 0) ? gOpcodeSizesScopeTable[OpCode].mSize : ObjBinLen;
mObjBinBuf = ((DelayEmit == FALSE) && (gCreateOp == TRUE)) ? gCFormPkg.IfrBinBufferGet (mObjBinLen) : new CHAR8[EFI_IFR_MAX_LENGTH];
mRecordIdx = (gCreateOp == TRUE) ? gCIfrRecordInfoDB.IfrRecordRegister (0xFFFFFFFF, mObjBinBuf, mObjBinLen, mPkgOffset) : EFI_IFR_RECORDINFO_IDX_INVALUD;
+ mLineNo = 0;
assert (mObjBinBuf != NULL);
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/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 = DEFAULT_PACK_ALIGN;
mPackStack = NULL;
mFirstNewDataTypeName = NULL;
+ mCurrDataType = NULL;
InternalTypesListInit ();
}
@@ -1605,6 +1606,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( IN EFI_VARSTORE_ID VarStoreId
)
{
+ memset (&mGuid, 0, sizeof (EFI_GUID));
if (StoreName != NULL) {
mVarStoreName = new CHAR8[strlen(StoreName) + 1];
strcpy (mVarStoreName, StoreName);
@@ -1616,6 +1618,7 @@ SVfrVarStorageNode::SVfrVarStorageNode ( mVarStoreType = EFI_VFR_VARSTORE_NAME;
mStorageInfo.mNameSpace.mNameTable = new EFI_VARSTORE_ID[DEFAULT_NAME_TABLE_ITEMS];
mStorageInfo.mNameSpace.mTableSize = 0;
+ mAssignedFlag = FALSE;
}
SVfrVarStorageNode::~SVfrVarStorageNode (
|