diff options
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4bytecodehandler.cpp | 3 | ||||
-rw-r--r-- | src/qml/compiler/qv4bytecodehandler_p.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp index d3c5582b28..e2533a0505 100644 --- a/src/qml/compiler/qv4bytecodehandler.cpp +++ b/src/qml/compiler/qv4bytecodehandler.cpp @@ -56,8 +56,9 @@ ByteCodeHandler::~ByteCodeHandler() { \ INSTR_##instr(MOTH_DECODE_WITH_BASE) \ Q_UNUSED(base_ptr); \ + _currentOffset = _nextOffset; \ + _nextOffset = code - start; \ startInstruction(Instr::Type::instr); \ - _offset = code - start; \ INSTR_##instr(DISPATCH) \ endInstruction(Instr::Type::instr); \ continue; \ diff --git a/src/qml/compiler/qv4bytecodehandler_p.h b/src/qml/compiler/qv4bytecodehandler_p.h index 5f1121306f..ca6abf3dc3 100644 --- a/src/qml/compiler/qv4bytecodehandler_p.h +++ b/src/qml/compiler/qv4bytecodehandler_p.h @@ -91,7 +91,8 @@ public: void decode(const char *code, uint len); - int instructionOffset() const { return _offset; } + int currentInstructionOffset() const { return _currentOffset; } + int nextInstructionOffset() const { return _nextOffset; } static std::vector<int> collectLabelsInBytecode(const char *code, uint len); @@ -102,7 +103,8 @@ protected: virtual void endInstruction(Moth::Instr::Type instr) = 0; private: - int _offset = 0; + int _currentOffset = 0; + int _nextOffset = 0; }; } // Moth namespace |