From 3c5cc414711f0d17bb32e7282eb21588947465a5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 30 Dec 2015 14:03:26 +0100 Subject: qdoc: Don't let a QML type be its own base type When qdoc runs without one or more of the index files for the modules it depends on, there was a chance it could set a QML type's base type to point to the QML type itself. This resulted in an infinite loop, which crashed qdoc with a bad alloc error. qdoc has now been changed so that it refuses to set a QML type's base type to itself. Change-Id: I08e8959ddb67b2d1f3b1bf44d9dc48624bafebfa Task-number: QTBUG-50163 Reviewed-by: Martin Smith --- src/qdoc/cppcodemarker.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/qdoc/cppcodemarker.cpp') diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index d4e7546e9..b0e4e823d 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -1306,6 +1306,12 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl } ++c; } + if (current->qmlBaseNode() == current) { + qDebug() << "qdoc internal error: circular type definition." + << "QML type" << current->name() + << "can't be its own base type"; + break; + } current = current->qmlBaseNode(); while (current) { if (current->isAbstract()) -- cgit v1.2.1