Engine identifiers are strings, which as Managed sub-classes have a pointer to
the internalClass. For strings we generally use engine->emptyClass. So before
creating any identifiers, engine->emptyClass must be initialized. Otherwise
putting any of the identifiers later into for example a QV4::PersistentValue
will cause crashes, because string->internalClass->engine will be an
uninitialized value.
Change-Id: I35a19a1701c5938b61f61e876d656e126a9b8e09
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
identifierCache = new Identifiers(this);
+ emptyClass = new (classPool.allocate(sizeof(InternalClass))) InternalClass(this);
+
id_undefined = newIdentifier(QStringLiteral("undefined"));
id_null = newIdentifier(QStringLiteral("null"));
id_true = newIdentifier(QStringLiteral("true"));
id_uintMax = newIdentifier(QStringLiteral("4294967295"));
id_name = newIdentifier(QStringLiteral("name"));
- emptyClass = new (classPool.allocate(sizeof(InternalClass))) InternalClass(this);
arrayClass = emptyClass->addMember(id_length, Attr_NotConfigurable|Attr_NotEnumerable);
initRootContext();