qtdeclarative/tests/auto/qml/qmlcppcodegen/data/DeduplicateConversionOrigin...

10 lines
151 B
QML
Raw Permalink Normal View History

Compiler: Deduplicate conversion origins based on register's content In the type propagator, when encountering back jumps, we need to run the pass again in order to ensure that the state of the registers at the target of the jump is fully known. For this, we need to compare the latest state in the current pass with states we have encountered earlier. If a match is found, no more passes are needed. The propagation is run multiple times and state is accumulated between passes. For certain conversions, this will try to append types as origins again every iteration. These would previously have been deduplicated by QQmlJSTypeResolver::merge but, since the change at 1e095058e165b1c2f244799ca1928ae4cc046a2c, we consider 2 registers to be equal only if their d pointers are equal. And since instructions such as MoveRegexp create a new register for the literal type RegExpr every time, the pointer doesn't match with the one from the register created by the instruction during the ealier pass. This would lead to set of origin types growing forever and to the state never matching a previous one. This, in turn, caused an infinite loop because an additional pass was always deemed necessary. Therefore, restore the old logic that deduplicates based on contained type, variant, and (recursively) scope. Amends 1e095058e165b1c2f244799ca1928ae4cc046a2c Fixes: QTBUG-135457 Pick-to: 6.9 Change-Id: I23167e95b958304698d12537598c1d72b03a5364 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-04-07 14:55:28 +00:00
import QtQml
QtObject {
function yep() {
try { }
catch (e) { replace(/()/, ""); }
for (let i = 0; i < 1; ++i) { }
}
}