Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
6.5.0
-
None
Description
The following code is generated for the childobject.qml test case:
// expression for objectName at line 12, column 5 QVariant r2_1; QString r2_2; // generate_LoadQmlContextPropertyLookup { QObject * retrieved; while (!aotContext->loadScopeObjectPropertyLookup(0, &retrieved)) { aotContext->setInstructionPointer(2); aotContext->initLoadScopeObjectPropertyLookup(0, []() { static const auto t = QMetaType::fromName("ObjectWithMethod*"); return t; }()); if (aotContext->engine->hasError()) return QString(); } r2_1 = QVariant::fromValue(retrieved); } // generate_GetLookup if (!r2_1.isValid()) { aotContext->setInstructionPointer(4); aotContext->engine->throwError(QJSValue::TypeError, QLatin1String("Cannot read property 'objectName' of undefined")); return QString(); } while (!aotContext->getObjectLookup(1, *static_cast<QObject *const *>(r2_1.constData()), &r2_2)) { aotContext->setInstructionPointer(4); aotContext->initGetObjectLookup(1, *static_cast<QObject *const *>(r2_1.constData()), QMetaType::fromType<QString>()); if (aotContext->engine->hasError()) return QString(); } // generate_Ret return r2_2;
Clearly, the retrieved pointer can never be undefined, but it can be null!