Fix using compound-assignment with an array

...that was initialized in the definition
master
melex750 2016-06-24 17:00:41 -04:00
parent 0d74b4f36b
commit 66984a4bb3
1 changed files with 9 additions and 0 deletions

View File

@ -121,6 +121,15 @@ CBotInstr* CBotDefArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResul
}
}
}
if (pStk->IsOk()) while (true) // mark initialized
{
var = var->GetItem(0, true);
if (var == nullptr) break;
if (var->GetType() == CBotTypArrayPointer) continue;
if (var->GetType() <= CBotTypString) var->SetInit(CBotVar::InitType::DEF);
break;
}
}
if (pStk->IsOk()) return pStack->Return(inst, pStk);