diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-07 15:28:55 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-08 09:56:04 +0000 |
commit | 63407a01ebf67c7383aea385ac6b4ccb734d96a1 (patch) | |
tree | 21dcd4690f086e6000ea4426b9b526a90210982a /src | |
parent | 1a6b2250906254c2284907ad2da632643e98acc4 (diff) |
Fix compression of jump instructions with an type >= 256
Those instructions are encoded with a two byte instruction id
that needs to be read correctly to figure out whether it's a wide
or narrow instruction.
Change-Id: I769d1a2d121f9f372105fa94771785d517694855
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/compiler/qv4bytecodegenerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp index 7e1f49ee86..8ecb762f9c 100644 --- a/src/qml/compiler/qv4bytecodegenerator.cpp +++ b/src/qml/compiler/qv4bytecodegenerator.cpp @@ -120,8 +120,8 @@ void BytecodeGenerator::adjustJumpOffsets() int jumpOffset = linkedInstruction.position - (i.position + i.size); // qDebug() << "adjusting jump offset for instruction" << index << i.position << i.size << "offsetForJump" << i.offsetForJump << "target" // << labels.at(i.linkedLabel) << linkedInstruction.position << "jumpOffset" << jumpOffset; - uchar type = *reinterpret_cast<const uchar *>(i.packed); - if (Instr::isWide(Instr::Type(type))) { + Instr::Type type = Instr::unpack(i.packed); + if (Instr::isWide(type)) { Q_ASSERT(i.offsetForJump == i.size - 4); qToLittleEndian<qint32>(jumpOffset, c); } else { |