diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-06-20 11:57:49 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-06-23 15:44:38 +0200 |
| commit | 32602bef7c40261cbe61d72e8cf043feb3734d3e (patch) | |
| tree | 08b937c68891fcfff999ebd939feedb71699e27b /tests/auto/qml/qmlcppcodegen/data/Categorizer.qml | |
| parent | 9035d1cb2a474a6df52ca395e6c185964ec94de0 (diff) | |
QmlCompiler: Sharpen side effect detection
Stack-created lists of primitives or pointers cannot be affected by side
effects. We cannot write a value affected by side effects to a list that
isn't, though.
Pick-to: 6.10 6.9 6.8 6.5
Task-number: QTBUG-137540
Change-Id: I99ab4337cabc6111a81b8164fd94962edc0db25e
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/Categorizer.qml')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/Categorizer.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/Categorizer.qml b/tests/auto/qml/qmlcppcodegen/data/Categorizer.qml index 10f2857c19..7ced17c37f 100644 --- a/tests/auto/qml/qmlcppcodegen/data/Categorizer.qml +++ b/tests/auto/qml/qmlcppcodegen/data/Categorizer.qml @@ -2,9 +2,31 @@ pragma Strict import QtQml QtObject { + enum Parameters { + Length = 32, + Iterations = 32768, + + Category0 = 0xf0f, + Category1 = 0xf0f0, + Category2 = 0xf0f0f, + Maximum = 0xf0f0f0, + Mask = 0xabcdef + } + property list<double> nnn: { var result = []; result[0] = 10; return result; } + + function randomNumber() : int { + return (Math.random() * Categorizer.Maximum); + } + + property list<double> numbers: { + var result = []; + for (var i = 0; i < Categorizer.Length; ++i) + result[i] = randomNumber(); + return result; + } } |
