diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-08-30 15:46:07 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-30 13:48:10 +0000 |
commit | bb26b8ea7b973cf53099a35028780309750b10c7 (patch) | |
tree | 686cdcd40eada89542b7d4486a7bb28b4dca15b9 /src/qml/compiler/qv4compiler.cpp | |
parent | 1b73484630e1fbf483a124f77c07265d695f9484 (diff) | |
download | qtdeclarative-bb26b8ea7b973cf53099a35028780309750b10c7.tar.gz |
QML: Make sure the integer data is aligned on 4-byte boundaries
The packing for a the compiled data is 1 byte, but integers clearly
need 4 byte alignment. This worked before by accident, but broke when a
single quint8 was added to the Function.
Change-Id: Ia7954423d5a7b4a0e6ef177fc3ee350889f43154
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index c6a872cc34..43347d246a 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -278,6 +278,7 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::IR::Function *i QV4::CompiledData::Function *function = (QV4::CompiledData::Function *)f; quint32 currentOffset = sizeof(QV4::CompiledData::Function); + currentOffset = (currentOffset + 7) & ~quint32(0x7); function->nameIndex = getStringId(*irFunction->name); function->flags = 0; |