aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2022-04-07 17:10:55 +0200
committerAndreas Buhr <andreas@andreasbuhr.de>2022-04-13 18:17:08 +0200
commit38d455dca051d7580449553d85b88d5df9d2162a (patch)
tree176b3c23513724cbcfb80ceba9e13c92ded7d7d7 /src/qml/jsruntime/qv4engine.cpp
parent4fcb34a9ed6530eea4d71b721e33431b0d82b4a2 (diff)
Adapt qv4engine to stack size on Android
Adapt maximum stack size to not run into segfaults due to stack overflow. Pick-to: 6.2 6.3 Task-number: QTBUG-102384 Task-number: QTBUG-96788 Change-Id: I4ba3518369c822b1b2d93388817beb7f86d19cdc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 033331e08e..d6ec79941d 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -354,13 +354,22 @@ void ExecutionEngine::initializeStaticMembers()
#if defined(QT_NO_DEBUG) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(address_sanitizer)
#ifdef Q_OS_QNX
s_maxCallDepth = 640; // QNX's stack is only 512k by default
+#elif defined(Q_OS_ANDROID)
+ // In experiments, it started crashing at 1059.
+ s_maxCallDepth = 1000;
#else
s_maxCallDepth = 1234;
#endif
#else
// no (tail call) optimization is done, so there'll be a lot mare stack frames active
+#ifdef Q_OS_ANDROID
+ // Android's stack seems to be about 1mb.
+ // In experiments, it started crashing at 82.
+ s_maxCallDepth = 80;
+#else
s_maxCallDepth = 200;
#endif
+#endif
}
}