diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-05-07 13:51:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-09 17:26:51 +0200 |
commit | 0640dce6cd3200979a9b98d5bbae4526fc6dcec8 (patch) | |
tree | 15cdc6be016ec728759ca9f0aed88870ed70044e /src/qml/compiler/qv4compiler.cpp | |
parent | 18a96e8f4913dd96bcead3ddde99a015737e3a3b (diff) |
Fix crash on host/target word size mismatches
When compiling on a 64-bit host and using the QV4::CompileData on a 32-bit
target, the size of QArrayData is different. Therefore we cannot use it in
the QV4::CompiledData and have to resort to storing only the characters in
there. We can at least still use fromRawData when extracting strings, but the
QStringData will have to be allocated now.
Change-Id: Ia9dab1722ed72186451b65ba74457051c6ce3155
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 65ef5c4b5e..144ef8a79e 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -82,11 +82,7 @@ void QV4::Compiler::StringTableGenerator::serialize(uint *stringTable, char *dat QV4::CompiledData::String *s = (QV4::CompiledData::String*)(stringData); s->flags = 0; // ### - s->str.ref.atomic.store(-1); - s->str.size = qstr.length(); - s->str.alloc = 0; - s->str.capacityReserved = false; - s->str.offset = sizeof(QArrayData); + s->size = qstr.length(); memcpy(s + 1, qstr.constData(), (qstr.length() + 1)*sizeof(ushort)); stringData += QV4::CompiledData::String::calculateSize(qstr); |