Kaydet (Commit) 36984c75 authored tarafından Julien Nabet's avatar Julien Nabet

cppcheck: false positive deallocuse

Help cppcheck by returning early and remove a now useless bool var

Change-Id: If4dcb6f64bcfd6c3cb22136163caf3679d6fd5a8
üst f909e39f
...@@ -1206,16 +1206,13 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) ...@@ -1206,16 +1206,13 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
SbiSymDef* pOld = aPublics.Find( pDef->GetName() ); SbiSymDef* pOld = aPublics.Find( pDef->GetName() );
if( pOld ) if( pOld )
{ {
bool bError_ = false;
pProc = pOld->GetProcDef(); pProc = pOld->GetProcDef();
if( !pProc ) if( !pProc )
{ {
// Declared as a variable // Declared as a variable
Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() ); Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() );
delete pDef; delete pDef;
pProc = nullptr; return;
bError_ = true;
} }
// #100027: Multiple declaration -> Error // #100027: Multiple declaration -> Error
// #112787: Not for setup, REMOVE for 8 // #112787: Not for setup, REMOVE for 8
...@@ -1226,16 +1223,12 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) ...@@ -1226,16 +1223,12 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
{ {
Error( ERRCODE_BASIC_PROC_DEFINED, pDef->GetName() ); Error( ERRCODE_BASIC_PROC_DEFINED, pDef->GetName() );
delete pDef; delete pDef;
pProc = nullptr; return;
bError_ = true;
} }
} }
if( !bError_ ) pDef->Match( pProc );
{ pProc = pDef;
pDef->Match( pProc );
pProc = pDef;
}
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment