From 4beea6bc83f315ec57fd07ea0c21767dc63127d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20De=20Canni=C3=A8re?= Date: Mon, 14 Apr 2025 16:09:55 +0200 Subject: qv4codegen: Track the correct location for assign instructions This fixes a qmllint warning about unqualified access in the wrong place in the following unconventional but valid case: Warning: .../Main.qml:5:9: Unqualified access [unqualified] console.log(a = 1) ^^^^^^^ Warning: .../Main.qml:5:21: Unqualified access [unqualified] console.log(a = 1) ^ Pick-to: 6.9 6.8 6.5 Change-Id: I8eaa43f520c394b094917fe37dc6115ec2f7af74 Reviewed-by: Ulf Hermann --- src/qml/compiler/qv4codegen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/compiler/qv4codegen.cpp') diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index bd98c9fe69..b57a21eab6 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1483,6 +1483,7 @@ bool Codegen::visit(BinaryExpression *ast) return false; } else if (ast->op == QSOperator::Assign) { + bytecodeGenerator->setLocation(ast->left->firstSourceLocation()); if (AST::Pattern *p = ast->left->patternCast()) { RegisterScope scope(this); Reference right = expression(ast->right); -- cgit v1.2.3