aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlparser
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-27 16:01:54 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-03-15 11:53:22 +0000
commit73231fe953145ac0df4e62f173e1a90076466012 (patch)
tree031a29f9c67be0f4fd903b18847d12081483e1b7 /tests/auto/qml/qqmlparser
parent93601b1fd4aae326562c6e7cfe16d5ecf2532a6a (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 'tests/auto/qml/qqmlparser')
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index c2c73935c0..71dd900073 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -105,6 +105,11 @@ public:
{
nodeStack.removeLast();
}
+
+ void throwRecursionDepthError() final
+ {
+ QFAIL("Maximum statement or expression depth exceeded");
+ }
};
}