From 25842cb13a18ec946fe80b6d869f2b00dbd2ce9c Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Tue, 29 Nov 2011 08:44:14 +0100
Subject: [PATCH] QmlJS: Add protection against attached types attaching to
 themselves.

Change-Id: Ib81d5e6baabf5ac8d18411e8936098908de2c2bb
Task-number: QTCREATORBUG-6635
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
---
 src/libs/qmljs/qmljsinterpreter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index 746bbb0f01d..c926fbd90a1 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -285,7 +285,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
     const QString &attachedTypeName = _metaObject->attachedTypeName();
     if (!attachedTypeName.isEmpty()) {
         const CppComponentValue *attachedType = valueOwner()->cppQmlTypes().objectByCppName(attachedTypeName);
-        if (attachedType)
+        if (attachedType && attachedType != this) // ### only weak protection against infinite loops
             attachedType->processMembers(processor);
     }
 
-- 
GitLab