Another this==nullptr fix (#828)

dev-buzzingcars
krzys-h 2016-11-11 22:58:39 +01:00
parent 48f703282e
commit b49fbf0cd6
2 changed files with 13 additions and 3 deletions

View File

@ -104,6 +104,7 @@ CBotDefParam* CBotDefParam::Compile(CBotToken* &p, CBotCStack* pStack)
bool CBotDefParam::Execute(CBotVar** ppVars, CBotStack* &pj) bool CBotDefParam::Execute(CBotVar** ppVars, CBotStack* &pj)
{ {
int i = 0; int i = 0;
assert(this != nullptr);
CBotDefParam* p = this; CBotDefParam* p = this;
while ( p != nullptr ) while ( p != nullptr )

View File

@ -334,7 +334,10 @@ bool CBotFunction::Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance)
if ( pile->GetState() == 0 ) if ( pile->GetState() == 0 )
{ {
if ( !m_param->Execute(ppVars, pile) ) return false; // define parameters if (m_param != nullptr)
{
if ( !m_param->Execute(ppVars, pile) ) return false; // define parameters
}
pile->IncState(); pile->IncState();
} }
@ -647,7 +650,10 @@ int CBotFunction::DoCall(CBotProgram* program, const std::list<CBotFunction*>& l
} }
// initializes the variables as parameters // initializes the variables as parameters
pt->m_param->Execute(ppVars, pStk3); // cannot be interrupted if (pt->m_param != nullptr)
{
pt->m_param->Execute(ppVars, pStk3); // cannot be interrupted
}
pStk1->IncState(); pStk1->IncState();
} }
@ -766,7 +772,10 @@ int CBotFunction::DoCall(const std::list<CBotFunction*>& localFunctionList, long
pStk->AddVar(psuper); pStk->AddVar(psuper);
} }
// initializes the variables as parameters // initializes the variables as parameters
pt->m_param->Execute(ppVars, pStk3); // cannot be interrupted if (pt->m_param != nullptr)
{
pt->m_param->Execute(ppVars, pStk3); // cannot be interrupted
}
pStk->IncState(); pStk->IncState();
} }