diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-27 16:01:54 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-15 11:53:22 +0000 |
commit | 73231fe953145ac0df4e62f173e1a90076466012 (patch) | |
tree | 031a29f9c67be0f4fd903b18847d12081483e1b7 /src/qml/parser/qqmljsastvisitor.cpp | |
parent | 93601b1fd4aae326562c6e7cfe16d5ecf2532a6a (diff) |
Unify the JavaScript parsing recursion checks
We only need to check in one central location and we can allow for more
recursion. 4k recursions seem tolerable. A common default for stack
sizes is 8MB. Each recursion step takes up to 1k stack space in debug
mode. So, exhausting this would burn about half of the available stack
size. We don't report the exact source location in this case as finding
the source location may itself trigger a deep recursion.
Fixes: QTBUG-74087
Change-Id: I43e6e20b322f6035c7136a6f381230ec285c30ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsastvisitor.cpp')
-rw-r--r-- | src/qml/parser/qqmljsastvisitor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/parser/qqmljsastvisitor.cpp b/src/qml/parser/qqmljsastvisitor.cpp index eec151298e..666623eecc 100644 --- a/src/qml/parser/qqmljsastvisitor.cpp +++ b/src/qml/parser/qqmljsastvisitor.cpp @@ -43,7 +43,7 @@ QT_QML_BEGIN_NAMESPACE namespace QQmlJS { namespace AST { -Visitor::Visitor() +Visitor::Visitor(quint16 parentRecursionDepth) : m_recursionDepth(parentRecursionDepth) { } |