aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-24 14:31:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-24 16:00:55 +0100
commit03a0773b1001728ca52d6cd5429e73445274ae81 (patch)
treed7e0d6d8da14d6c112ee885bc2214bf261ce8d85 /src/qml/jsruntime
parent18f21746d7e58bec0a819d84fe17f245a8439ae8 (diff)
Fix infinite loop in method overload resolution
When resolving overloaded slots in a situation without property cache, then we need to detect that we've reached the end of the overload lists and exit from RelatedMethod with zero. Task-number: QTBUG-37157 Change-Id: Ifaab8cc1b377725c99c1bb89bb9bb74d5a0af1b8 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 1cfd2d88ec..dd58e0609b 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1315,6 +1315,11 @@ static const QQmlPropertyData * RelatedMethod(QObject *object,
methodOffset -= QMetaObject_methods(mo);
}
+ // If we've been called before with the same override index, then
+ // we can't go any further...
+ if (&dummy == current && dummy.coreIndex == current->overrideIndex)
+ return 0;
+
QMetaMethod method = mo->method(current->overrideIndex);
dummy.load(method);