diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-17 15:30:54 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-27 15:08:29 +0100 |
commit | 2b5e0f90112fe85872894fb16e811203d4d3671f (patch) | |
tree | c7e883e6dd2dddf9711f7f412d81873fc7a35244 /src/qml/qml/qqmlvmemetaobject.cpp | |
parent | 40f2dbd5557da2103e03a3fb7682bbfda3ffd122 (diff) |
V4: Fix mark stack overruns
Instead of applying a heuristic on when to call drain() in unrelated
code, we check the stack limit on each push(). If the soft limit is
reached we try to drain. As drain() itself can push again, we try to
limit the stack size by allowing at most 65 recursions of drain(). If
none of that helps, we crash with a meaningful error message.
This allows us to remove all the hacky drain() calls in other parts of
the code.
Change-Id: Ib979339470da0e85981de8131e7997755b757c71
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index edf9657f53..aa9f4bc1bd 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -1238,7 +1238,7 @@ void QQmlVMEMetaObject::ensureQObjectWrapper() void QQmlVMEMetaObject::mark(QV4::MarkStack *markStack) { - if (engine != markStack->engine) + if (engine != markStack->engine()) return; propertyAndMethodStorage.markOnce(markStack); |