Fixed crash when accessing undefined user variable

Presence of DECORATE user variable was not checked before attempting to read or write its value from ACS
This commit is contained in:
alexey.lysiuk 2016-02-20 15:34:41 +02:00 committed by Christoph Oelckers
parent b8f8daf1c1
commit 7b49d9d92c

View file

@ -4564,13 +4564,13 @@ bool GetVarAddrType(AActor *self, FName varname, int index, void *&addr, PType *
{
PField *var = dyn_cast<PField>(self->GetClass()->Symbols.FindSymbol(varname, true));
PArray *arraytype;
BYTE *baddr = reinterpret_cast<BYTE *>(self) + var->Offset;
if (var == NULL || (var->Flags & VARF_Native))
{
return false;
}
type = var->Type;
BYTE *baddr = reinterpret_cast<BYTE *>(self) + var->Offset;
arraytype = dyn_cast<PArray>(type);
if (arraytype != NULL)
{