If o is not created, then ddata on the next line may also not create
successfuly leading to an invalid memory access before we reach the !o
exception.
Change-Id: I9b127dff7955456aacb25138fabaabaabaab921f
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
QObject *o = 0;
void *memory = 0;
type.type->create(&o, &memory, sizeof(QQmlData));
+
+ if (!o)
+ VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()),
+ instr.line);
+
QQmlData *ddata = new (memory) QQmlData;
ddata->ownMemory = false;
QObjectPrivate::get(o)->declarativeData = ddata;
ddata->propertyCache->addref();
}
- if (!o)
- VME_EXCEPTION(tr("Unable to create object of type %1").arg(type.type->elementName()),
- instr.line);
-
if (states.count() == 1) {
// Keep a reference to the compiled data we rely on
ddata->compiledData = states[0].compiledData;