aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorMaximiliano Curia <maxy@debian.org>2016-07-19 15:49:48 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-07-20 12:51:39 +0000
commitd6ac86f59250e05eb5e7db5bb8a45a85db1f0f25 (patch)
treeacddbbceeb32b63668b1c8e65ea04c4427e16559 /src/qml/jsruntime/qv4value_p.h
parent06ed1ad17abe1ef597d4ecf86962da5ac21365e5 (diff)
Fix QQmlEngine crash on big endian 64 bit architectures (s390x)
This change disables the BIG_ENDIAN 32 bits words mangling in 64 bits machines (where the words are 64 bits long); this would otherwise result in a segfault. Task-number: QTBUG-54717 Change-Id: I6b5ab6f213880b030795185c05e609d290168901 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Timo Jyrinki <timo.jyrinki@iki.fi> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 7c2bb31a00..5abf5ad9e8 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -96,13 +96,13 @@ public:
Q_ALWAYS_INLINE quint64 rawValue() const { return _val; }
Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN || defined(QV4_USE_64_BIT_VALUE_ENCODING)
static inline int valueOffset() { return 0; }
static inline int tagOffset() { return 4; }
Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; }
Q_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); }
Q_ALWAYS_INLINE quint32 tag() const { return _val >> 32; }
-#else // !Q_LITTLE_ENDIAN
+#else // !Q_LITTLE_ENDIAN && !defined(QV4_USE_64_BIT_VALUE_ENCODING)
static inline int valueOffset() { return 4; }
static inline int tagOffset() { return 0; }
Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(value) << 32 | tag; }