Commit Graph

20976 Commits

Author SHA1 Message Date
Ulf Hermann b0e9c83f99 Don't store the scope in JSCallData
We only need it when generating CallData, or when filling in any
thisObject or arguments that weren't provided. Provide a constructor
that expects thisObject and arguments to be pre-allocated and one that
allocates them in a scope passed as argument.

Change-Id: Iddfba63f4dbc5b09e2b33fb22a94eea88f515902
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-17 13:10:16 +01:00
Alexandru Croitor 2fab46e711 CMake: Fix building some of the manual tests
Change-Id: I2ab5f2913d8a346f4283a961677e8272a69b3e1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-17 11:35:30 +01:00
Alexandru Croitor 53af0e192f CMake: Add missing listview manual test project
Amends 78ab4b8d8b

Fixes: QTBUG-84869
Change-Id: I868434dd604ab80c1609bf08a73f940cabc9b2e1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-17 11:35:28 +01:00
Laszlo Agocs 4fb84137f1 Bake shaders at build time
Change-Id: Ia6879ca75750ceb54f145dab9d25ac1ed78289a2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-17 08:30:46 +01:00
Xiao YaoBing 073f3d23b2 make isRightAligned() const and setNoiseSource() const reference
Guessing the const specifier was accidentally forgotten

Change-Id: I88aaacbd9f8562c8a0b800013bb596c166fae6d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-17 10:21:02 +08:00
Ivan Solovev 698bbb74f0 Reintroduce XmlListModel to qml models description page
Now when the XmlListModel is again a part of Qt, we can reintroduce the
section describing it to the models documentation page.

Task-number: QTBUG-89817
Change-Id: I8937fa30da26209fe3672dad86d094b139dab6c5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-16 23:07:57 +01:00
Siyeon Seo 447831e6e0 Avoid crash when accessing an empty QTextLine
In any case an empty QTextLine should not be used. Q_ASSERT doesn't help
in non-debug build.

Change-Id: I10b7895bc9b4cfd061aea086f810a9f8bf6d301a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-17 06:53:37 +09:00
Fabian Kosmale 0aad1a6c3c Correctly specify extension type for model index value types
Those are not only foreign types, but also extension types which add
additional properties. Thus we also need to mark them as QML_EXTENDED.

Pick-to: 6.1
Change-Id: I7a0469f7760887318a2b34bc5fcb85f011c0b0bf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-16 20:22:53 +00:00
Qt Submodule Update Bot 6879c0645f Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Ie7a658196b2d0ff45389eebb1a7c6c95b8befdb9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-03-16 21:06:18 +02:00
Fabian Kosmale d64e7c9c6c QQmlPropertyBinding: handle reset
Bindings are allowed to toggle between a defined state, and undefined
which calls the property's reset function. Calls to the reset function
must not remove the binding, even when they write to the property.

To support this, we put the binding in a special undefined state, in
which it is still active (and installed on the property), but does not
actually provide its evaluated value to the property. Then, when the
binding later becomes defined again, the binding leaves its undefined
state and works normally again.

Notes:
- Calling the reset function during binding evaluation could have all
  kinds of unwelcome side-effects. We therefore have to suspend binding
  evaluation before the reset call (and restore that state afterwards).
- QObjectCompatProperty expects that we write the current value into the
  propertyDataPtr. If we do not do this, it will overwrite the current
  value with the default constructed value of its property. Arguably, we
  should change the API so that we communicate that nothing has changed;
  but for now, we have to live with that limitation and read the
  current value and write it back again.
- We currently do not handle the case correctly where a non-resettable
  property implemented via QObjectCompatProperty gets assigned undefined
  in a binding. Such a binding is likely unintentional (as the undefined
  assignment only creates a warning), and thus less of a priority.
  Nevertheless, a test marked with QEXPECT_FAIL is added for it.

Fixes: QTBUG-91001
Change-Id: I7ecaa6c8dc1a1f1b33e67b1af65f552c4ca6ffb1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-15 11:42:15 +01:00
Qt Submodule Update Bot 3b39f700fb Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I883df348fe68b6ff0153c1f3f23fafae53250952
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-03-15 05:34:46 +02:00
Craig Scott 759446963d CMake: Fix wrong variable name used to accumulate -I options for qmllint
Fixes: QTBUG-91727
Change-Id: I190b3d1959efdb99c9eb88b4953c0a586ea0faa5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-15 11:17:28 +11:00
Shawn Rutledge 463ac8b43d Prevent infinite recursion in QQuickItemPrivate::itemToWindowTransform
Not sure what the XXX TODO was for, but maybe some error checking...
This infinite recursion seems to happen in some pathological case, but
not normally, of course.

Change-Id: I6ad56e4b3002d151b2e6007669c46f0507d7f0e0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-14 10:09:58 +01:00
Fabian Kosmale 7a97989ea0 Reduce the size of QQmlPropertyData
We can observe the following:
- m_arguments stores information about method arguments, mostly their
  names and types. This information is only relevant for methods.
- m_staticMetaCallFunction is used to optimize reads from and writes to
  properties. It is never used for functions.
As the pointers are never used at the same time, we can thus put them
into a union, reducing the size of QQmlPropertyData by up to 20%.

Change-Id: I1f7c651fae429d4e2d1cffa62f84311ad9abadf8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-14 08:46:26 +01:00
Maximilian Goldstein c214b690f8 QtQuick.Particles: Make plugin optional
Mark plugin as optional and move out initialization code as to allow use with
the QML compiler.

Change-Id: Id2c88c1c1c33d1053606d459059e7908baf2ddf7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-14 00:40:46 +01:00
Mitch Curtis d61ececdb8 Expose formattedDataSize() in QML Locale type
This was added to qtbase in 9d23aeb.

Qt Quick Dialogs needs it to display file sizes in FileDialog.

[ChangeLog][QML][Locale] Added formattedDataSize() for formatting
quantities of bytes as kB, MB, GB etc.

Fixes: QTBUG-91283
Change-Id: I8ea64f961c04d4900d18fa45398670df89882c56
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-13 20:03:49 +01:00
Ulf Hermann acf3a16800 Do not set up JS arguments when calling an AOT function
We won't use them anyway and it's expensive.

Change-Id: I869b915afeac2f3882a959bea8a92dc2279d0b3e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-13 12:56:52 +01:00
Ulf Hermann 490257d447 Optimize QML context retrieval for AOT functions
We can cache the QQmlContextWrapper rather than retrieving it twice.

Inline some things, and do not unnecessarily create and destroy ref
pointers.

Change-Id: Ife0980f83b7efe1ea9dc56aacbfbccd029ce77c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-13 12:56:47 +01:00
Ulf Hermann eb2386a042 Optimize ExecutionEngine::metaTypeToJS()
We almost never need to construct a QVariant to do this. Constructing a
QVariant is excessively expensive if you have something simple like an
integer. This also fixes the unexpected "unwrapping" of variants when we
pass them through QJSValue.

[ChangeLog][QtQml][Important Behavior Changes] If you create a QJSValue
from a nested QVariant (that is, a QVariant containing another
QVariant), then, when retrieving its contents again, the outer variant
is not unwrapped anymore. Rather, you get exactly the value you've
passed in.

Change-Id: I8c16eed4f13e8cfdeced0756eef593b3b8e84dd1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-13 10:08:48 +01:00
Maximilian Goldstein a9c93e2716 qmlscene: Show deprecation warning
qmlscene will be removed in favor of qml in the future.

[ChangeLog][QML][Important Behavior Changes] qmlscene is deprecated, please use qml instead

Task-number: QTBUG-53557
Task-number: QTBUG-53219
Task-number: QTBUG-65862
Change-Id: Ia295cdf0749ce79f6523dabebd43f0168e81c1f0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-12 22:34:16 +00:00
Ulf Hermann e228615c84 qmllint: Resolve field member expressions on aliases
Change-Id: I8332abda8983bae47110573d765d5733ff4589e6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 17:15:29 +01:00
Ulf Hermann 0c5b453356 qmllint: Also return non-zero on errors if we don't CheckIdentifiers
Change-Id: Ia5e1601de03aa4a925932999fb7bb5ff67daad75
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 17:15:18 +01:00
Ulf Hermann 482b7adcb7 CMake: Automatically add prefer directive to qmldir files
In qt6_add_qml_module we know that we are going to put all the QML files
listed in the generated qmldir into the resource path. We can thus
safely point the QML engine there.

This reveals that QtTest's plugin is actually not optional. It does
contain the compiled QML code.

Change-Id: Ia20f98c481482a851558c7ebeb39c9c365355d0a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 17:14:56 +01:00
Ulf Hermann 9970ebb277 Replace std::variant with tagged union in QJSPrimitiveValue
Pick-to: 6.1
Fixes: QTBUG-91717
Change-Id: Id19e08589206253b96c76bc40a799ccd95b0e0bf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-12 12:30:30 +01:00
Ulf Hermann 5e280b8792 Add QVariantList to builtins
It can be used as generic sequence type.

Change-Id: I731e0c85d4c66dc48ec5efce281a11b1310c51c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 12:30:07 +01:00
Maximilian Goldstein 31ad81d81e qqmldelegatemodel: Fix out of bounds cache removal
Pick-to: 5.15 6.0 6.1
Task-number: QTBUG-91276
Change-Id: I1ddbb4a3326d61ff94e3881beb64a14dade11c46
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-12 09:11:11 +00:00
Maximilian Goldstein 2af18cace6 qmlimportscanner: Mark plugins as optional
qmlimportscanner will now relay information about whether or not a plugin is optional.
Tooling will need to be adapted to take advantage of this.

Fixes: QTBUG-91087
Change-Id: I3f4097ce797c02d9018f98f4e57453179e4f8fec
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 10:11:03 +01:00
Ulf Hermann 4020838122 qmllint: Return non-zero exit code for any warnings generated
A linter should not return zero if it has found problems.

Change-Id: If949c5b01cd9c617d760c2c72cc7bfe29f3d3f95
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 08:49:48 +01:00
Shawn Rutledge 476a4b91d7 Add QQuickDeliveryAgentPrivate::isHoverEvent()
It's just another type-switching function, needed in QtQuick3D now.

Change-Id: I6ecc6d82177368556cbab1b3fd038ce325f39496
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-11 23:21:31 +01:00
Richard Moe Gustavsen bb3c62332c QQuickHoverHandler: listen for HoverLeave events
Let HoverHandler listen for HoverLeave events, so that we can explicitly
tell it to leave its hovering state from the outside.

The new function gets used in a follow up patch.

Change-Id: Ieaaeb7dc4e4afc96bb60c7abfd34f2c2c09bef47
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-11 22:00:26 +01:00
Alexander Akulich 35a0c2552f TestCase: Fix colors comparison in fuzzyCompare()
fuzzyCompare() messed up the arguments and compared the first color
argument with itself (ignoring the second color).

Fixes: QTBUG-91694
Pick-to: 5.15 6.0 6.1
Change-Id: I86453c937e27a2112f8375b144ca21a9d088f017
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-11 15:44:28 +03:00
Maximilian Goldstein b3567c177f QtQuick.tooling: Add isRequired to Property
Previously parsing qmltypes with qml would fail due to this.

Change-Id: Ib5498eb75cbb6873cc5d4e8c798baefa1204bd8a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-11 10:31:07 +01:00
Andreas Hartmetz 9f8292d489 QQuickWindow: don't leak old screenChanged connections
Connections could accumulate. Because the newest one was invoked
last due to how signal-slot invocations are ordered, rendering
was correct, but the stale connections caused unnecessary updates
(and wasted a small amount of memory).
This comes from a misunderstanding I had at the time about how
QMetaObject::Connection works. Destroying or overwriting one does
not affect the actual connection.

While at it, also modernize the connect().

Pick-to: 5.15 6.0 6.1
Change-Id: Idde81bdbff8947ed517bf2740d623a395c0acb74
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-10 19:53:21 +01:00
Fabian Kosmale 9521937b38 Completely remove parentChanged
It is already set to nullptr in qobject.cpp (until its removal there,
which this patch prepares).
Amends 86e9e61cad.

Change-Id: I13e293030e8e734a1015cc98572abbbbc44a573f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-10 19:35:20 +01:00
Oliver Eftevaag 1d3cdac6e4 Update canvas example to use QtQuickControls2
The QtQuick examples should ideally have a more native look and feel.
Making them use controls from QtQuickControl will cause them to adapt to
the desktop style.

This patch replaces the previous Sliders from the 'shared' directory,
with Sliders from QtQuickControls2

Task-number: QTBUG-90880
Change-Id: I90521abf7059950521bc3d1a54994d2cca07259d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-03-10 17:53:22 +01:00
Ivan Solovev ea8f8e0900 Introduce XmlListModel to QtDeclarative
XmlListModel was previously a part of QtXmlPatterns, which would not
be a part of Qt 6. The idea of this commit is to move a simplified
version of XmlListModel to QtDeclarative, so that it could be used
at least in the examples of different Qt modules.

Unlike the old implementation, this version does not have an XPath
support. This results in a reduced feature set - the user can't
build complicated XPath queries to populate model roles.
Now the user can select an xml element and, optionally, an
attribute, which will be used to extract the data.

[ChangeLog][XmlListModel] Introduce an XmlListModel QML model to
create read-only models from XML data.
This is a simplified version of a model from QtXmlPatterns, which
would no longer be a part of Qt 6. This model supports only simple
slash-separated paths and, optionally, one attribute for each
element.

Task-number: QTBUG-89817
Change-Id: I4186587dc1445dd981ac92b4ce104434236a32b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-10 15:17:57 +01:00
Craig Scott c42d558dc9 CMake: Fix argument handling in qt_internal_add_qml_module() and friends
If OUTPUT_DIRECTORY is set, all the QML files, as well as the qmldir and
the plugin should end up in that directory. We should not confuse that
with the install directory, which is separate.

For qt_internal_add_qml_module(), we can provide the defaults for both
OUTPUT_DIRECTORY and INSTALL_DIRECTORY. For the latter, don't support
a separate INSTALL_LOCATION keyword, only use INSTALL_DIRECTORY.
With these changes, qtbase no longer has to contain qml-specific
logic for these paths in QtPluginHelpers.cmake.

Refactor the way arguments are collected and passed through to the
internal call to qt6_add_qml_module(). This simplifies the code and
also exposed that QML_FILES was not being identified as an allowed
argument, TYPEINFO was the wrong type of argument and DO_NOT_INSTALL
was not a valid argument (or at least was ignored).

The qt_internal_add_module() function was also duplicating logic that
was largely already implemented by qt6_add_qml_module(). Rework
things a little to remove that duplication.

Task-number: QTBUG-88763
Pick-to: 6.1
Change-Id: I629ff63a9f8302c79694970f7b8e664a2b5d587b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-10 23:17:29 +11:00
Qt Submodule Update Bot ba9261a3a2 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I4f183dac26f4d266408716c11154c6b558261ec5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-03-10 14:17:29 +02:00
Fabian Kosmale 8f0b91e120 Fix crash in QQmlPropertyBinding is not bound to property
In contrast to other QPropertyBindings, QQmlPropertyBinding could be
executed even if it is not installed on a property. This would happen if
we keep a strong reference to it, remove it from a property, and change
one of the observed JS dependencies. That would lead to a call of
expressionChanged, and then subsequently to an evaluate call. As setting
and removing the binding from a property can be done purely in C++, we
cannot detect this in the engine (which would allow us to disable the
binding, so that expressionChanged does not get called). Thus, we simply
check if the property data pointer is set when expressionChanged is
called, and return otherwise.

Task-number: QTBUG-89505
Change-Id: I933c1b3285d6472b1d2c6512ad37911090861298
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-10 10:26:52 +01:00
Laszlo Agocs ef16f8876d Port shader code example in GridMesh docs
Pick-to: 6.0 6.1
Change-Id: Ic3a11d24fdc02fa383350997083b38407d75feab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-10 10:26:00 +01:00
Qt Submodule Update Bot 1c6ed24f0e Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Iea2a2e5605ab0693d5d26e6f9f94dafbb1177cbd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-03-10 06:17:36 +02:00
Ulf Hermann 1b2f487474 CMake: Skip lowercase names in qmldir files
If a "component" has a lower case name it's not a component and there
is no point in listing it in the qmldir.

Change-Id: I38c91b9206342184a8c3e55b20d732b40ce6d7c2
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-09 21:26:03 +01:00
Andrei Golubev 6f514e88fe Don't duplicate imports for different versions
We only discern imports if they live in different directories. Versions
are not handled, yet. If we add support for versions, the versioning
should be applied on processImport().

Done-with: Ulf Hermann <ulf.hermann@qt.io>
Change-Id: I2243452457e76a91042d1556edc5d36826560758
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-09 16:46:57 +01:00
Andy Shaw e0400d0875 Ensure that the case of the path will match then QUrl for a UNC path
When a UNC path is used to locate the qmldir then when it is checked
later on the original path will be compared against the one that QUrl
returns. However, QUrl will convert the case of the host name to be
all lower-case whereas the original string may have been in upper-case.

For example, QUrl::fromLocalFile("//QT-L-R90X9VHB/tasks").toString()
will output "file://qt-l-r90x9vhb/tasks".

So in this case, the absoluteFilePath is changed at this point so that
it will match what QUrl has for the same path to avoid a problem with
it no being found.

Pick-to: 6.1 6.0 5.15
Change-Id: I2cd5d74bfec06c01635f80574ac1a6d479792855
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-09 12:18:31 +00:00
Andrei Golubev 602982993c qmllint: check default properties
Implement the check for default properties

Default aliases are not included in this patch

[ChangeLog][QML][qmllint] Add support for default properties

Change-Id: I2d0330e32c1f49c83d3a4ed602250b6bfd4ec674
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-09 10:13:34 +01:00
Richard Moe Gustavsen 220e6a5a76 QQuickDeliverAgent: change sendHoverEvent signature
Now we intend to always send pre-accepted hover events,
for consistency with event delivery in the rest of Qt.

This is mostly done as a preparation for later patches.

Change-Id: I5833b5ed9971057ace272a7bfc390fd336cc2e7d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-09 08:29:04 +01:00
Richard Moe Gustavsen ccecd6e883 QQuickItem: reject hover events if not handled
This is the pattern we follow elsewhere in Qt - the event starts
out as accepted, and stays that way if it ends up being delivered
to an overridden event handler.  Otherwise the default handler
will reject it.
This change doesn't affect any of the pointerhandler auto tests.

This change is mostly a preparation for a later patch, which
relies on this standard behavior.

Change-Id: I158c828e958b5c1943ecd552a9594d24a3aaa90b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-09 08:28:54 +01:00
Qt Submodule Update Bot 1ea5bd6d59 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I8686be4615d639044a05e226bc2408ca64f1e2c8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-03-09 06:47:02 +02:00
Maximilian Goldstein bbba1e5614 qmllint: Implement deprecation warnings
Make qmllint warn about @Deprecated {} annotations.
Also adds support for annotations in qmlcompiler.

[ChangeLog][QML][qmllint] Add support for deprecation annotations.

Task-number: QTBUG-84895
Change-Id: Ia506a6c0077a2b9ab3bf4fdac207bd0540635b30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-08 15:54:02 +01:00
Maximilian Goldstein 7ea690c61d qv4generatorobject: Fix crash when creating new properties
Previously HeapObject::GeneratorObject utilized a ValueArray member to store stack information.
As we rely on all HeapObject members to have a constant size in order for QV4Table::inlinePropertyOffset
to remain accurate, this lead to a memory conflict when a user defined his own property on the Generator.

Please do not use ValueArray for any types that are user accessible or that you intend to add properties to.

Now the stack information is stored into ArrayObjects instead which circumvents the issue.

Fixes: QTBUG-91491
Pick-to: 5.15 6.0 6.1
Change-Id: Id6f638bf36a3ae3c9320ac99e67214c48dc81226
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-08 15:53:45 +01:00