aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlirbuilder_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-13 13:41:42 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-05-19 12:46:28 +0000
commit219873c65fed284310bfb6d32d8b7ddf8fc15da1 (patch)
treec61624106f0b42977ac9f7e0d5d829de15504b06 /src/qml/compiler/qqmlirbuilder_p.h
parentef6469a95948b8c95ed6fb0cbbe7daaa1960c956 (diff)
Fix regression with assignments to default properties
With commit ad8d760decd5f1c6242a42688417b3c86122121c the precision of the location (row/column) fields was reduced. The same fields are used to preserve the insertion orer of bindings as they appear in the .qml file, which meant that for large qml files without any line feeds we may end up with an overrun in the column range (2048). This happened in the Tests_TabView::test_mousePressOnTabBar test in qtquickcontrols. The reduced precision is fine because those column/row fields should only be used for error reporting. In this case where we need the precision we can just as well use the file offset in the temporary QML-IR Binding data structure. Task-number: QTBUG-53115 Change-Id: Ifb6f76b4f83a06fa228211134d12cc67c071bbec Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index 057ed1be9f..18daab9ce4 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -113,7 +113,7 @@ struct PoolList
T *insertPos = 0;
for (T *it = first; it; it = it->next) {
- if (!(it->*sortMember < item->*sortMember))
+ if (!(it->*sortMember <= item->*sortMember))
break;
insertPos = it;
}
@@ -227,6 +227,10 @@ struct Property : public QV4::CompiledData::Property
struct Binding : public QV4::CompiledData::Binding
{
+ // The offset in the source file where the binding appeared. This is used for sorting to ensure
+ // that assignments to list properties are done in the correct order. We use the offset here instead
+ // of Binding::location as the latter has limited precision.
+ quint32 offset;
// Binding's compiledScriptIndex is index in object's functionsAndExpressions
Binding *next;
};