From 2235d6b77afd893a7c60d6c38d16f75fe2042144 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 Mar 2014 13:25:02 +0100 Subject: [new compiler] Fix potential infinite recursion when using the incubator Some auto-tests use the incubation controller with a one-step boolean, so shouldInterrupt() always returns true. When we're in the finalization phase enabling the bindings one-by-one, pop one off the bindings stack and enable it _before_ doing the shouldInterrupt() check. Otherwise we don't progress at all. Change-Id: Ibd5bbc253f8e8f74b08c91b018533c9e2735d2c8 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlobjectcreator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/qml/qqmlobjectcreator.cpp') diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index f8aadb3070..0df52edb08 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1170,9 +1170,6 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru trace.event("begin binding eval"); while (!sharedState->allCreatedBindings.isEmpty()) { - if (watcher.hasRecursed() || interrupt.shouldInterrupt()) - return 0; - QQmlAbstractBinding *b = sharedState->allCreatedBindings.pop(); if (!b) continue; @@ -1182,6 +1179,9 @@ QQmlContextData *QQmlObjectCreator::finalize(QQmlInstantiationInterrupt &interru data->clearPendingBindingBit(b->propertyIndex()); b->setEnabled(true, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); + + if (watcher.hasRecursed() || interrupt.shouldInterrupt()) + return 0; } } -- cgit v1.2.3