aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-07-10 14:49:33 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-07-10 13:00:33 +0000
commite3a8aa0096daaa23920b75d3ef786d300562efb2 (patch)
treeb7a39744826150f527bf71705f5d0e83322ae422 /src/qml/jsruntime/qv4context_p.h
parente4912d9b30e4cd202cd4895766b879f0980c37f6 (diff)
Fix alignment issue on most 32bit arm platforms
The ARM eabi states that 64bit integers are 8-byte aligned (note: iOS explicitly makes an exception to this). The size of the ExecutionContext is 9 "pointers" in size, the CallData is 4 "pointers" in size, so on 64bit architectures CallContext is a nice 13 "pointers" sized structure. However, on ARM the last element of CallData (ValueArray) has a QV4::Value as its last element, and this needs to be 8-byte aligned. So, padding will be inserted, and that will grow it from 15 "pointers" to 16. Task-number: QTBUG-61874 Change-Id: Iba4bc805ef6b459928ef09d604504e896732a8f2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4context_p.h')
-rw-r--r--src/qml/jsruntime/qv4context_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 3db9e72acf..f0596c6c8b 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -173,7 +173,11 @@ Q_STATIC_ASSERT(std::is_standard_layout<CallContextData>::value);
Q_STATIC_ASSERT(offsetof(CallContextData, v4Function) == 0);
Q_STATIC_ASSERT(offsetof(CallContextData, function) == QT_POINTER_SIZE);
Q_STATIC_ASSERT(offsetof(CallContextData, locals) == offsetof(CallContextData, function) + QT_POINTER_SIZE);
+#if defined(Q_PROCESSOR_ARM_32) && !defined(Q_OS_IOS)
+Q_STATIC_ASSERT(sizeof(CallContext) == sizeof(ExecutionContext) + sizeof(CallContextData) + QT_POINTER_SIZE);
+#else
Q_STATIC_ASSERT(sizeof(CallContext) == sizeof(ExecutionContext) + sizeof(CallContextData));
+#endif
#define CatchContextMembers(class, Member) \
Member(class, Pointer, String *, exceptionVarName) \