summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-qv4engine-getStackLimit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/dyson-qv4engine-getStackLimit.patch')
-rw-r--r--debian/patches/dyson-qv4engine-getStackLimit.patch25
1 files changed, 15 insertions, 10 deletions
diff --git a/debian/patches/dyson-qv4engine-getStackLimit.patch b/debian/patches/dyson-qv4engine-getStackLimit.patch
index 09b6006..6d5019b 100644
--- a/debian/patches/dyson-qv4engine-getStackLimit.patch
+++ b/debian/patches/dyson-qv4engine-getStackLimit.patch
@@ -1,11 +1,11 @@
-Index: qtdeclarative-opensource-src-5.2.1/src/qml/jsruntime/qv4engine.cpp
+Index: qtdeclarative/src/qml/jsruntime/qv4engine.cpp
===================================================================
---- qtdeclarative-opensource-src-5.2.1.orig/src/qml/jsruntime/qv4engine.cpp 2014-02-02 00:38:02.000000000 +0400
-+++ qtdeclarative-opensource-src-5.2.1/src/qml/jsruntime/qv4engine.cpp 2014-04-27 09:34:20.425260667 +0400
-@@ -77,6 +77,10 @@
- #if USE(PTHREADS)
- # include <pthread.h>
- # include <sys/resource.h>
+--- qtdeclarative.orig/src/qml/jsruntime/qv4engine.cpp
++++ qtdeclarative/src/qml/jsruntime/qv4engine.cpp
+@@ -84,6 +84,10 @@
+ #if HAVE(PTHREAD_NP_H)
+ # include <pthread_np.h>
+ #endif
+# if OS(SOLARIS)
+# include <thread.h>
+# include <errno.h>
@@ -13,7 +13,7 @@ Index: qtdeclarative-opensource-src-5.2.1/src/qml/jsruntime/qv4engine.cpp
#endif
QT_BEGIN_NAMESPACE
-@@ -106,6 +110,14 @@
+@@ -113,6 +117,19 @@ quintptr getStackLimit()
} else
size = pthread_get_stacksize_np(thread_self);
stackLimit -= size;
@@ -23,8 +23,13 @@ Index: qtdeclarative-opensource-src-5.2.1/src/qml/jsruntime/qv4engine.cpp
+ do {
+ rc = thr_stksegment(&ss); // can fail only with EAGAIN
+ } while ((rc != 0) && (errno == EAGAIN));
-+ stackLimit = reinterpret_cast<quintptr>(ss.ss_sp);
-+ stackLimit -= ss.ss_size;
++ // Is stack "unlimited" ?
++ if (ss.ss_size == RLIM_INFINITY) {
++ stackLimit = 0xFFFF800000000000L;
++ } else {
++ stackLimit = reinterpret_cast<quintptr>(ss.ss_sp);
++ stackLimit -= ss.ss_size;
++ }
# else
void* stackBottom = 0;
pthread_attr_t attr;