aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-04-12 09:36:31 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-12 11:38:17 +0000
commitce452b70e158461b021aa47faf5cce87964b6cf7 (patch)
tree05e630be647118ff9511467d69c2f4d9ad6eb2db /src/qml
parent8050979c10e485166bd30ccc929140e4b66e84b5 (diff)
QV4EngineBase: Do not create zero-sized array on 32 bit platforms
Zero-sized arrays are a non-standard extension, and do not work on MSVC. We can instead conditionally add an explicit padding member on platforms where POINTER_SIZE == 8. Fixes: QTBUG-92562 Change-Id: I8462eb05e16c42045c0c95f026321c6e20e5c6bb Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 506463fe8ae0125f18d6236db9b7cd8b99885d08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsruntime/qv4enginebase_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4enginebase_p.h b/src/qml/jsruntime/qv4enginebase_p.h
index 612c2dd453..17e47e1b05 100644
--- a/src/qml/jsruntime/qv4enginebase_p.h
+++ b/src/qml/jsruntime/qv4enginebase_p.h
@@ -88,7 +88,9 @@ struct Q_QML_EXPORT EngineBase {
MemoryManager *memoryManager = nullptr;
qint32 callDepth = 0;
- quint8 padding2[QT_POINTER_SIZE - sizeof(quint32)];
+#if QT_POINTER_SIZE == 8
+ quint32 padding2;
+#endif
Object *globalObject = nullptr;
Value *jsStackLimit = nullptr;
Value *jsStackBase = nullptr;