diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-29 13:30:42 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-10-13 22:13:12 +0200 |
commit | ae49af00b59628623bc15e19974ee5af5f0121ba (patch) | |
tree | 91488d095e7a5b52bb1b8df05e56fb668039ea7b /src/qml/compiler/qv4codegen.cpp | |
parent | 9cfc19faf5d1ce2b9626914ab4528998b072385d (diff) |
QML: Track the statement indices together with line numbers
We will need the statement indices when tracking value type references.
New value type references shall only be written back in the same
statement they were created in.
Task-number: QTBUG-99766
Change-Id: I83f908df034e7da8ba46ccacaa29bd9d78020d20
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 9b0efcba41..2f5a9bd55f 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -373,6 +373,7 @@ void Codegen::statement(Statement *ast) { RegisterScope scope(this); + bytecodeGenerator->incrementStatement(); bytecodeGenerator->setLocation(ast->firstSourceLocation()); VolatileMemoryLocations vLocs = scanVolatileMemoryLocations(ast); @@ -388,6 +389,7 @@ void Codegen::statement(ExpressionNode *ast) } else { RegisterScope scope(this); + bytecodeGenerator->incrementStatement(); pushExpr(Result(nx)); VolatileMemoryLocations vLocs = scanVolatileMemoryLocations(ast); qSwap(_volatileMemoryLocations, vLocs); @@ -3382,7 +3384,7 @@ int Codegen::defineFunction(const QString &name, AST::Node *ast, AST::FormalPara qDebug() << "=== Bytecode for" << _context->name << "strict mode" << _context->isStrict << "register count" << _context->registerCountInFunction << "implicit return" << requiresReturnValue; QV4::Moth::dumpBytecode(_context->code, _context->locals.size(), _context->arguments.size(), - _context->line, _context->lineNumberMapping); + _context->line, _context->lineAndStatementNumberMapping); qDebug(); } } |