aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4bytecodegenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator.cpp')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp
index 3c28f6a719..1d4e91bdf6 100644
--- a/src/qml/compiler/qv4bytecodegenerator.cpp
+++ b/src/qml/compiler/qv4bytecodegenerator.cpp
@@ -97,7 +97,7 @@ void BytecodeGenerator::finalize(Compiler::Context *context)
int offset = instructionOffsets.at(j.instructionIndex) + j.offset;
// qDebug() << "offset data is at" << offset;
char *c = code.data() + offset;
- int linkedInstructionOffset = instructionOffsets.at(linkedInstruction) - offset;
+ int linkedInstructionOffset = instructionOffsets.at(linkedInstruction) - instructionOffsets.at(j.instructionIndex + 1);
// qDebug() << "linked instruction" << linkedInstruction << "at " << instructionOffsets.at(linkedInstruction);
memcpy(c, &linkedInstructionOffset, sizeof(int));
}