summaryrefslogtreecommitdiffstats
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:58:29 +0000
commitbcd7b0fe55355d7d4de7d38a0c8a22e5c0e1e6aa (patch)
tree947d74e2bdadc15e8a520f2c9fb899848f35e708
parentd250e0070701e9c511ef5b1fb0d23995872ad844 (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>
-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;