QmlJS: Avoid infinite loop with recursive prototypes.

This commit is contained in:
Christian Kamm
2010-11-12 14:53:00 +01:00
parent 443be8eea6
commit f7a077b1fa
8 changed files with 135 additions and 47 deletions

View File

@@ -1055,11 +1055,13 @@ protected:
{
Bind *bind = m_lookupContext->document()->bind();
const Interpreter::ObjectValue *objValue = bind->findQmlObject(ast);
QStringList prototypes;
if (!objValue)
return false;
while (objValue) {
prototypes.append(objValue->className());
objValue = objValue->prototype(m_lookupContext->context());
QStringList prototypes;
foreach (const Interpreter::ObjectValue *value,
Interpreter::PrototypeIterator(objValue, m_lookupContext->context()).all()) {
prototypes.append(value->className());
}
return prototypes.contains(QString("QGraphicsObject"));