Make sure to initialize the property data (especially setter/getter) in
insertMember() right away to zero, to avoid marking uninitialized objects
in code like this when the GC happens in code like this:
Property *pd = o->insertMember(...)
f = someFunctionThatAllocates();
pd->setSetter(f);
Change-Id: I55e4846c0e5027bb95a1da13df30bcf9eca28645
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
memberDataAlloc = qMax((uint)8, 2*memberDataAlloc);
Property *newMemberData = new Property[memberDataAlloc];
memcpy(newMemberData, memberData, sizeof(Property)*idx);
+ memset(newMemberData + idx, 0, sizeof(Property)*(memberDataAlloc - idx));
if (memberData != inlineProperties)
delete [] memberData;
memberData = newMemberData;
Property *p = insertMember(s, Attr_Accessor);
FunctionObject* f = v4->newBuiltinFunction(v4->rootContext, s, method_get_platform);
p->setGetter(f);
- p->setSetter(0);
}
{
String *s = v4->newString(QStringLiteral("application"));
Property *p = insertMember(s, Attr_Accessor);
FunctionObject* f = v4->newBuiltinFunction(v4->rootContext, s, method_get_application);
p->setGetter(f);
- p->setSetter(0);
}
#ifndef QT_NO_IM
{
Property *p = insertMember(s, Attr_Accessor);
FunctionObject* f = v4->newBuiltinFunction(v4->rootContext, s, method_get_inputMethod);
p->setGetter(f);
- p->setSetter(0);
}
#endif
}