aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v5.15.18-lts' into tqtc/lts-5.15-opensourceTarja Sundqvist2025-03-303-35/+43
|\ | | | | | | | | | | Qt 5.15.18-lts release Change-Id: I264fc86c512cc5b23b6e6279a1c086a619b07a2b
| * Fix heap-buffer-overflow in ESTable::removeOliver Dawes2024-04-162-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a heap-buffer-overflow issue in ESTable::remove due to an off by one error in the count provided to memmove calls. Task-number: QTBUG-123999 Change-Id: I4ee0fbc16ba8936ea921e5f1d1bb267dae0b1d5f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d3e36454830012e4fd4c538ddeab7cddbfacdc24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3241bb2e5e9a4a8c35254fc279d216b6da81780e) (cherry picked from commit 42b8085b50627fa7aa14cd6d5af7ad7fbfce85d0) (cherry-picked from commit 49ef3d89747523d75371c488bcb49b17bcaf0cfc)
| * V4: Don't call methods on nullptrUlf Hermann2024-04-091-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The root node of a sparse array can be null. Fixes: QTBUG-123596 Change-Id: I5ea7fd73aeec460082d0cf19c7fc8a01993ed1f9 Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e221e1e942f58750af0a93232354a2ad35c74bcf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 590db8ac18f92c594ff7dbf4b4c020aaec546c44) (cherry picked from commit 08a318b3dc377a0a6fea88332ceebf166ac741f1) (cherry picked from commit 1a5ffffcb05effb68e33ef4b45376d2b8d9b3ff0)
* | Merge tag 'v5.15.17-lts' into tqtc/lts-5.15-opensourceTarja Sundqvist2024-11-201-1/+1
|\| | | | | | | | | | | Qt 5.15.17-lts release Change-Id: I85da10a6f1030e50730c7aaee4c71ae861f1ecc4
| * QtQml: Clear context objects more thoroughly on destructionUlf Hermann2024-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same object can be the context object of a hierarchy of contexts. So far we would only clear one of them, leaving dangling pointers in the others. Clear all the contexts. Fixes: QTBUG-119326 Change-Id: I509f257672813866e3736b51f430f1243a8577f0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 27ba69af2f64a8b194655c9fbb276ce981075f75) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 833f4f6913835a18c37b02bd4784d62cbb4d0701) (cherry picked from commit 477c3c3c25d478caa5b833a9c64f3945b3d3a83e) (cherry picked from commit 7318fadc42e462babeca473864d12cfd033ffa42) (cherry picked from commit e1ded8e46f71c12855811d0ee1cb2c36dcf67517)
* | Merge tag 'v5.15.16-lts' into tqtc/lts-5.15-opensourcev5.15.16-lts-lgplTarja Sundqvist2024-11-089-30/+94
|\| | | | | | | | | | | Qt 5.15.16-lts release Change-Id: I2892ad4097deaec565b10357ca61be10048a7c81
| * QML Debugger: Don't crash when looking up values from imported modulesUlf Hermann2023-11-014-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot look up the imports from other modules because those are stored in the CU. But we can avoid the crash. Fixes: QTBUG-117479 Change-Id: Ib5660c94dfb7ed20baedf7f71b2f175e6be042b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 604da0a395840d7370cde1a55db460156c3a3e8c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5e34cf725637e91dbe5a7f81f51ceba23ffe435d) (cherry picked from commit 4365e9ee2fc5b510b545772bf5a14f122467682d) (cherry picked from commit e5bde5cfdb96521e6dc1dd3918d746d534739a6a) Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
| * QQmlSequence: fix compilation with GCC12/C++20Marc Mutz2023-09-151-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The V4_OBJECT2 macro passes its first argument to Q_DISABLE_COPY and the extra template decorator then yields an invalid constructor name that previous versions of C++ and/or GCC accepted, but newer ones don't. We fixed a few of these in qtwebengine/src/3rdparty/chromium, too. Fixes: QTBUG-117018 Change-Id: I8ab1cab276b81894a7013667259ce0d2f33a4997 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
| * Context properties: Don't trigger an assert for numeric namesFabian Kosmale2023-09-124-18/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic in our IdentifierHash assumes that every entry is a StringOrSymbol; however, IdentifierTable::asProperyKey will convert keys that look like numbers to ArrayIndex instead. This is noramlly what we want, and not an issue, except for setContextPropery where the user can pass an arbitrary string that is not necessarily a valid identifier. In an ideal world, we would just disallow such identifiers, but for backward compatibility change the code to handle this case (avoiding a Qt internal assert). We only need to modify the QString overloads, as those are the only ones that interact with unsanitized user input. A later commit will modify setContextPropery to warn if the key is numeric. Fixes: QTBUG-115319 Change-Id: Ifc4e4d2bc99321836e6976c4cbd0c5ff687b430c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b2b90c7cf5cb5205f2c5b374f7332252205385e8) Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* | Merge tag 'v5.15.15-lts' into tqtc/lts-5.15-opensourcev5.15.15-lts-lgplTarja Sundqvist2024-07-231-5/+33
|\| | | | | | | | | | | Qt 5.15.15-lts release Change-Id: I0272e1ec4b55be362e13e36cd48f532fe4b7c770
| * QV4::ArrayData: Fix offset calculation for sort()Ulf Hermann2023-07-261-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | We cannot just sort the raw values. We have to take the offset into account. If the array wraps around the end of the allocation, we have to move it around to be contiguous. Fixes: QTBUG-58718 Change-Id: I1866b3f271d97352e250d687955af3fc54340334 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit f0b2fbcf47f00071a7f5f1a04258d451badcb81a)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.13' into ↵v5.15.13-lts-lgplTarja Sundqvist2024-01-041-0/+5
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I7060c2fbc681a8bd0fc1be478db2ab67976db5b9
| * QJSEngine: Fix potential JS stack overflow cauased by spread operatorFabian Kosmale2023-01-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | createSpreadArguments could in theory allocate a (nearly) unbounded number of QV4::Values. Avoid this by checking whether we approach jsStackTop. This fixes CVE-2022-43591. Change-Id: I01aecb979da47b7261688c9f185dc33a50a579a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 6511aa4344c1d47ede8546540fe70bdff8523545)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into ↵v5.15.12-lts-lgplTarja Sundqvist2023-10-114-12/+36
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ia60d01835108b0a461791e56388eb3dfe90649e2
| * QV4: Avoid memory corruption in Reflect.applyFabian Kosmale2022-12-054-9/+27
| | | | | | | | | | | | | | | | | | | | | | This extracts the check from Function.prototype.apply into a shared function, and uses it in Reflect.apply, which has the same issue. Task-number: QTBUG-107619 Change-Id: I899464c86554f9bbb5270a95bbe3fe27531e9a27 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0e963a53c04b0dbe172cfb495b4d62dc8e2f31a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QML: Check for stack overflows when creating objectsUlf Hermann2022-11-221-3/+9
| | | | | | | | | | | | | | | | Fixes: QTBUG-106875 Change-Id: I3b0abda6948b79a9e3cf263f27885037fff1804c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit edc01fbfa430d6f0ce66f1871ab28e0f691ee252)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into ↵v5.15.11-lts-lgplTarja Sundqvist2023-06-0910-90/+248
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I7b6e0ef657d1278405738f682b2795f8c345c3d4
| * V4: Account for the guard pages when allocating stack spaceUlf Hermann2022-09-091-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we've assumed the whole allocation can be used, even though the first and the last page are actually not usable. This makes a difference when the size of the guard pages grows, such as on macOS, which these days has 16k pages. Add the extra guard page size to the amount of memory to be allocated in order to fix the calculation. Fixes: QTBUG-93188 Change-Id: I0ebece94449da3127e9a78a19d8a22722ad8d698 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 826b77c8cf0ffbef4f95e7b9e72eb9dc25936657)
| * V4: Mark InternalClass parents when running GCUlf Hermann2022-08-296-63/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to preserve them as they notify us about protoId related changes. In order to avoid wasting heap space in case many properties are added and removed from the same object, we put a mechanism in place to rebuild the InternalClass hierarchy if many redundant transitions are detected. Amends commit 69d76d59cec0dcff4c52eef24e779fbef14beeca. Fixes: QTBUG-91687 Task-number: QTBUG-58559 Change-Id: I3238931b5919ed2b98059e0b7f928334284ce7bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0b9fa18dfefc06f542bd0c98b7e41fa14aa0c2cf)
| * QML: Port QV4::CompiledData::RegExp to new special integer bitfieldUlf Hermann2022-06-241-2/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: I37be080387bf086d84761b056140cc5a99d161ed Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit da09f7c3d8962b4521189c96adf1ed0e1da3e8dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QML: Port QV4::CompiledData::JSClassMember to new special integer bitfieldUlf Hermann2022-06-241-2/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: I0a7d86450011f1664d61db4d78317dafbcfbb8cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit b5a8a6943ab979e23db284780df9209af5ae03a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QML: Port QV4::CompiledData::Object to new special integer bitfieldUlf Hermann2022-06-241-6/+7
| | | | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: Ia57a16313e883a8d4dab15c971181440ed1d2214 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 745cce4391a8b6255605cb304d8bc14b11168423)
| * QML: Port icutils::Node to new special integer bitfieldUlf Hermann2022-06-241-1/+1
| | | | | | | | | | | | | | Change-Id: I46f4f21bda1360d09e2c49a1f04dbe411fb46f7d Task-number: QTBUG-99545 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit eca5dcab020a60a53c0ad1b130cf2873d3feff3e)
| * QML: Port QV4::CompiledData::Lookup to new special integer bitfieldUlf Hermann2022-06-241-2/+2
| | | | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: I8cc6db56642f1cd2d16e80ba5c49ffd7c6fdcd8c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 6d92633f32ff2089b8f0a39e07f0d40bf57d8011)
| * QML: Port QV4::CompiledData::Binding to new special integer bitfieldUlf Hermann2022-06-242-3/+3
| | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: I9f8bc5fa45c61f77ee95b055a3d8de001da8f8c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ebee4e69182f0e44d87691d4740b271e1dcf38)
| * QML: Port QV4::CompiledData::Location to new special integer bitfieldUlf Hermann2022-06-243-5/+10
| | | | | | | | | | | | | | | | Task-number: QTBUG-99545 Change-Id: If0d6f893f2351a4146ddf125be4079b5e312f308 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 893b6ae6e890a2b8fc842d9c9cc64b9b8f34e22f)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.10' into ↵v5.15.10-lts-lgplTarja Sundqvist2023-04-242-3/+5
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I49d3f2094eee9709c4cd68433047dfad0c3414fa
| * Qml: includemocsMarc Mutz2022-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Manual conflict resolutions: - dropped all inclusions into non-existing files - qv4sequenceobject_p.h doesn't have Q_GADGETs in 5.15 - QQmlProperty and QQmlScriptString are not Q_GADGETs in 5.15 Task-number: QTBUG-102948 Change-Id: Ie39c60a19ba562affe6bd52ba68b38db95298cf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 26992a29c6ec1697fe6cec3379b37d1c9b203947) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * V4 ArrayIterator: Protect retrieved value from GCUlf Hermann2022-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | When constructing the iterator return object, the garbage collector may run, and drop the element value we want to return. Fixes: QTBUG-101700 Change-Id: I60c9b0b9fbb9e784fa089a8b5bb274d02ef7fc1f Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 185760fa44f5b62f1ed3f10a458f4bc38072768f) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into ↵v5.15.9-lts-lgplTarja Sundqvist2023-03-232-3/+6
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I91d2b178e7111d0802ea973bccf230b264c30c96
| * V4: Do not call dtor of an object we continue to useUlf Hermann2022-02-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After destroyObject(), the QObjectWrapper is still alive. We might use its heap object again. Furthermore, the Heap::QObjectWrapper dtor does not actually do anything defined. What we want to do here is clear the QObject pointer because we've just gotten rid of the QObject. There is a method for that: Heap::QObjectWrapper::destroy(). Finally, the internalClass must never ever be nullptr. Assert on that rather than checking it. Task-number: QTBUG-100431 Change-Id: I794a295c182b2ed4ba80673f58d6143c861b7391 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6c197319f34b8098d034f1543eb5feb9d7be54c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Adjust default max call depth for QNXUlf Hermann2022-01-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | QNX by default has smaller stacks than other platforms. Change-Id: Ia83d4e12c0fd24c51069777db2283d456c49800f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> (cherry picked from commit 7680fc7beed9c9f8e3883ac1796ef332cf40a4c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Do not copy lookupsUlf Hermann2021-12-165-67/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It leads to data corruption. Also, be more careful about releasing the property cache. We can only do that if the qobjectlookup member of the union is active. Unfortunately we have to do a number of checks now, to make sure it is. In order to still keep the checks inline, we move some functions around. Fixes: QTBUG-99211 Change-Id: If6dd879e67b172e1a9035e83fbfacbe73c6c7476 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e24effdceb3a504182ae271200408750991aa94a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-106-78/+137
|\ \ | | | | | | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I2e0f34eea87c1393dff82f153650eccf5048248f
| * | Do not copy lookupsUlf Hermann2021-12-155-67/+107
| |/ | | | | | | | | | | | | | | | | | | | | | | | | It leads to data corruption. Also, be more careful about releasing the property cache. We can only do that if the qobjectlookup member of the union is active. Unfortunately we have to do a number of checks now, to make sure it is. In order to still keep the checks inline, we move some functions around. Pick-to: 5.15 Fixes: QTBUG-99211 Change-Id: If6dd879e67b172e1a9035e83fbfacbe73c6c7476 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * V4 Lookup: Do not leak property cachesUlf Hermann2021-12-103-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a function that performs a lookup is called recursively via the flushing of initial bindings, we may initialize the same lookup twice. In that case, make sure to release the old property cache before overwriting it. We might suspect that this can only re-assign the same property cache again and therefore we can skip the whole operation if it has been done before. Yet, considering the dynamic nature of QML, it's very hard to guarantee this. There are cases where we have to revert lookups because the types don't match anymore at the time we call them again. I cannot rule out the possibility of this happening during initialization. Therefore, the code doesn't try to be clever about this case and instead just blindly overwrites the lookup (like it did before, just without leaking). Fixes: QTBUG-98722 Change-Id: I536deef282bbff723f79a82e4d9e694c3d2d32df Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 90790ef23bb148b4ac4c055bd3c11153b4c9a502)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.6' into ↵v5.15.6-lts-lgplTarja Sundqvist2022-08-163-3/+47
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ic3ca76460360cbab866a4e881c4848e6deeaf7d7
| * Use QDateTime to get offsets for emscripten (wasm)Edward Welbourne2021-08-131-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since our wasm implementation doesn't have access to time-zone data by default, but its QDateTime implementation does manage to get offsets right for local time, use it as fall-back for V4's Date implementation's DaylightSavingTA() and getLocalTZA(). This implementation might also be viable for other cases without timezone support (and a way to reset it when the system zone has changed), but we'll need to experiment to find out. For now, since we have nothing better for wasm, use it there. In passing, update a comment about a bug report against the ECMA spec to say it's been fixed (and we're compatible with the result). Fixes: QTBUG-95314 Change-Id: I40c1537815ada950dc0b5cebd4d641f7bfc45bd9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit 373897481fb930055e6e89035b1055f8dd80b83f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QV4::Heap::GeneratorObject: remove unused memberFabian Kosmale2021-08-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The member was marked as a Pointer for the gc; however it was never used, and thus also left uninitialized. This could cause memory corruption or asserts during the gc's mark phase. Fixes: QTBUG-95417 Change-Id: Ide826c0284b6060de8689e6f0dc753011108dba9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit d36b480a956e2437888925aa8a1f5e3cb6c06ebd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Register the QML builtin sequence metatypes only onceUlf Hermann2021-07-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Use the C++11 guarantee on function-local statics to be initialized exactly once for this. This does not apply to Qt6 because there the sequence types have been rewritten. Task-number: QTBUG-93973 Change-Id: Ia885f59da287036efa998cdf32211bb029090334 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into ↵v5.15.4-lts-lgplTarja Sundqvist2022-04-073-13/+13
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I39595f8b7ad212c842709b939226d95531819391
| * Assert that pointer is non-nullFabian Kosmale2021-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...else the analyser gets confused. mapFn only is true when argc is greater than 2, and the second argument is actually a function. In that case, we know that mapArguments is not null, as we've called scope.alloc. Silences report 0b232fda14. Pick-to: 6.1 Change-Id: I8d20ad2fcb0b9fcc4a6451e85f61e9a63679ee26 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 5cd39d8418df74fb8e5b50fdeff591cfc951ece2)
| * qv4generatorobject: Fix crash when creating new propertiesMaximilian Goldstein2021-03-082-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: Id6f638bf36a3ae3c9320ac99e67214c48dc81226 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 7ea690c61dabd2485e80e7fae9aed392ba02c846) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-24141-2896/+2896
|/ | | | | | | | | | | This reverts commit 7b1331c789df0ac12d7cf5aa5f8967b8651a4cfa. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I47eb004523bdb3beb16e9fd51e40da6f738f9f34 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* QV4 Engine: Remove MSVC special casingFabian Kosmale2021-02-103-18/+2
| | | | | | | | | | | | This patch removes a workaround for old versions of MSVC; we should be able to rely on the standard library nowadays. Original-patch-by: Alexander Neumann Fixes: QTBUG-89203 Change-Id: I8047565000fc7e4e3b8ac28584ff4a479b648274 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fb4de27768935393744cbd67e9789d325e70e742) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-02141-2896/+2896
| | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtdeclarative. Examples, documentation files or tests are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4161 Change-Id: Ic1d011aa01b1fe7242bcbbf72d5ab454d1015cf9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cache static compilation unitsUlf Hermann2021-01-143-12/+61
| | | | | | | | | | | | If we load the same file multiple times, we can re-use the old mapping. In fact we may leak memory if we don't. The fact that we have to use a mutex here is somewhat regrettable, but I haven't found a better way of serializing access. Task-number: QTBUG-89659 Change-Id: Iaa44ac80faa5e95f30c05e950ab35083a8b0416b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7660c30e08975011c7bd47bcb1796139b9d77196)
* masm: Add error handling for failed mprotect()Ulf Hermann2021-01-121-1/+4
| | | | | | | | | | | | | If we cannot mprotect() we have to abort the JIT compilation. Delete RepatchBuffer.h as it is unfixable in that regard. Luckily we don't use it. Task-number: QTBUG-89659 Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 131e2c81d40e3d324c62e113749a08e7993d008f) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* JIT: When making memory writable, include the exception handlerUlf Hermann2020-12-263-6/+22
| | | | | | | | | | | | | makeWritable() rounds the memory down to the next page boundary. Usually we include the exception handler this way, unless the offset from the page boundary is less than the exception handler size. Make it explicit that we do want the exception handler to be writable, too. Fixes: QTBUG-89513 Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Fix proxy iterationFabian Kosmale2020-12-231-2/+6
| | | | | | | | | | | If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274)