diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-06-13 22:51:51 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-06-20 09:46:45 +0000 |
commit | 8776da68f53afe7e2f5cb50a242aa97a80383b43 (patch) | |
tree | 82fbca31bf3e946bbedb94f3fbe2d370182e5c10 /src/qml/compiler/qv4bytecodegenerator.cpp | |
parent | 0cb56e810c587de469ee483bfbaafb325c871930 (diff) |
Implement support for conditional expressions
Change-Id: Ifcd57713e1cfa9514d3955e26f739a359cdaa8e5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qv4bytecodegenerator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp index 0073cb4598..444d8385d4 100644 --- a/src/qml/compiler/qv4bytecodegenerator.cpp +++ b/src/qml/compiler/qv4bytecodegenerator.cpp @@ -70,12 +70,15 @@ QByteArray BytecodeGenerator::finalize() } // resolve jumps +// qDebug() << "resolving jumps"; for (const auto &j : jumps) { Q_ASSERT(j.linkedInstruction != -1); int offset = instructionOffsets.at(j.instructionIndex) + j.offset; +// qDebug() << "offset data is at" << offset; char *c = code.data() + offset; - int linkedInstruction = instructionOffsets.at(j.linkedInstruction) - offset; - memcpy(c, &linkedInstruction, sizeof(int)); + ptrdiff_t linkedInstruction = instructionOffsets.at(j.linkedInstruction) - offset; +// qDebug() << "linked instruction" << j.linkedInstruction << "at " << instructionOffsets.at(j.linkedInstruction); + memcpy(c, &linkedInstruction, sizeof(ptrdiff_t)); } return code; |