aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscodegenerator.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-06-24 10:50:51 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-06-28 11:37:51 +0200
commite9c2ccd8be271c79996065d045642c586817b4d6 (patch)
tree539e562416650293fce59240c828a284f0eed8d8 /src/qmlcompiler/qqmljscodegenerator.cpp
parenta87e2eb0f5a1da8d47d4765e13b16205cdbc0730 (diff)
QmlCompiler: Add missing parentheses to in-place arithmetic operations
Fixes: QTBUG-104512 Change-Id: I3d592eeda5cefd9e9805b1811b37bebec5d6fc9c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7230508c3bf7d42fc2d262d29f9302ac46c3a4f0)
Diffstat (limited to 'src/qmlcompiler/qqmljscodegenerator.cpp')
-rw-r--r--src/qmlcompiler/qqmljscodegenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljscodegenerator.cpp b/src/qmlcompiler/qqmljscodegenerator.cpp
index 24fbdfe140..d4402a0599 100644
--- a/src/qmlcompiler/qqmljscodegenerator.cpp
+++ b/src/qmlcompiler/qqmljscodegenerator.cpp
@@ -2324,7 +2324,7 @@ void QQmlJSCodeGenerator::generateInPlaceOperation(const QString &cppOperator)
m_body += u"auto converted = "_s + var + u";\n"_s;
m_body += m_state.accumulatorVariableOut + u" = "_s + conversion(
m_typeResolver->original(m_state.accumulatorOut()),
- m_state.accumulatorOut(), cppOperator + u"converted"_s) + u";\n"_s;
+ m_state.accumulatorOut(), u'(' + cppOperator + u"converted)"_s) + u";\n"_s;
m_body += u"}\n"_s;
generateOutputVariantConversion(m_typeResolver->containedType(original));
}