aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-02-18 12:31:54 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-21 07:19:16 +0000
commit02f9fd8af162532aae8554382ea41e135931a146 (patch)
tree656805b311a586510637b7f8ea47641c4e843779 /tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml
parentcf284c869600d8b3d957f4a27bc7ba1dbf204f09 (diff)
QmlCompiler: Avoid infinite loop in dead store elimination
We have to mark the required variables also in block 0. And we shouldn't generate empty blocks. Fixes: QTBUG-101011 Change-Id: I0dd19f69f45f507cb83e2ddfba3060de48a940b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 88147eb3f621e7d972410698d6edca16493d7c66) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml b/tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml
new file mode 100644
index 0000000000..f493e4b942
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/deadStoreLoop.qml
@@ -0,0 +1,13 @@
+import QtQuick
+import QtQuick.Controls.Basic
+
+Item {
+ Menu {
+ id: m
+ }
+ function c() {
+ while (m.count > 0) {
+ m.removeItem(m.itemAt(0))
+ }
+ }
+}