Use AddField() to add user variables in DECORATE

This commit is contained in:
Randy Heit 2016-04-03 15:48:09 -05:00
parent 806d9d7a95
commit da496bbe62

View file

@ -584,9 +584,8 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl
}
sc.MustGetToken(';');
PField *sym = new PField(symname, type, 0);
sym->Offset = cls->Extend(type);
if (symt->AddSymbol(sym) == NULL)
PField *sym = cls->AddField(symname, type, 0);
if (cls == NULL)
{
sc.ScriptMessage ("'%s' is already defined in '%s'.",
symname.GetChars(), cls ? cls->TypeName.GetChars() : "Global");