aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2015-02-04 13:24:53 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-21 08:52:06 +0000
commit9934c075c707138f3e23e7e45858e2f108195b7e (patch)
treeb0e9993c03c402be097f8636c8a5fc1b62900b92
parentf0f3edafdbcafa2adb6e58a63b45d1660e69724c (diff)
QML: do not check stack size if stack grows up
On architectures where the stack grows upwards (i.e. HP PA-RISC) the stack limit calculation fails because the variables used to check the offset are usually close to the bottom of the stack, which is in this case the origin of the stack grows. Since these machines are a rare obscurity simply assume that everything is fine on these machines. The few people that are indeed running QML on such machines will probably be able configure their stack size properly by default. Task-number: QTBUG-44268 Change-Id: Ia83a39179a0f6e0602ba7a5032d386e12d8d1ba3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--src/qml/jsruntime/qv4engine.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 5bba745ae2..6156e5c3d9 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -108,8 +108,14 @@ quintptr getStackLimit()
} else
size = pthread_get_stacksize_np(thread_self);
stackLimit -= size;
+# elif defined(__hppa)
+ // On some architectures the stack grows upwards. All of these are rather exotic, so simply assume
+ // everything is fine there.
+ // Known examples:
+ // -HP PA-RISC
+ stackLimit = 0;
+
# else
- void* stackBottom = 0;
pthread_attr_t attr;
#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
// on FreeBSD pthread_attr_init() must be called otherwise getting the attrs crashes
@@ -117,7 +123,9 @@ quintptr getStackLimit()
#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
#endif
+ void *stackBottom = Q_NULLPTR;
size_t stackSize = 0;
+
pthread_attr_getstack(&attr, &stackBottom, &stackSize);
pthread_attr_destroy(&attr);