Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.2.1
Description
I create a QML object with the function createQmlObject and a very long qml String (more than 7KB in only one line)
In Debug mode, it throws a debug error:
Program: C:\Qt\6.2.1\msvc2019_64\bin\Qt6Cored.dll Module: 6.2.1 File: C:\Users\qt\work\qt\qtdeclarative\include\QtQml\6.2.1\QtQml\private\../../../../../src/qml/common/qv4compileddata_p.h Line: 144 ASSERT: "column == c" in file C:\Users\qt\work\qt\qtdeclarative\include\QtQml\6.2.1\QtQml\private\../../../../../src/qml/common/qv4compileddata_p.h, line 144
If we analyse the qv4compileddata_p.h source code:
struct Location
{
union {
quint32 _dummy;
quint32_le_bitfield<0, 20> line;
quint32_le_bitfield<20, 12> column;
};
Location() : _dummy(0) { }
Location(quint32 l, quint32 c)
: Location()
{
line = l;
column = c;
Q_ASSERT(line == l);
Q_ASSERT(column == c); // line 144
}
It appears that the pair (line,column) is stored in a 32bit location, with 20 bits for the line number and 12 bits for the column.
So a line length has to be inferior to 4096.
This limitation should be added to the documentation.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-98460 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
382492,2 | QV4::CompiledData: Properly encapsulate Location::line/column | dev | qt/qtdeclarative | Status: NEW | +2 | 0 |
382493,2 | WIP: QV4::CompiledData: Mark Location as invalid on line or column overflow | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
452050,1 | WIP: Location overflow | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |