aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcachegen
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-16 15:02:05 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-16 15:22:30 +0200
commit84d58a43cdb62a78f47d1823794349b6d822bc3a (patch)
tree729b39b40de485c2f1cecf81e3c09dd2821882e2 /tests/auto/qml/qmlcachegen
parent1061e74206592ec1791cadf47e66cf323f525ea4 (diff)
Make qmlcachegen test ASAN clean
The unitSize given there is the size of the qmlData. The previous code copied some other random stuff around. Change-Id: Idb5efac27fa9fbf6950850050627822a824e97ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcachegen')
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
index 6e6c9d7346..c6ec2eb780 100644
--- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
+++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
@@ -371,7 +371,9 @@ void tst_qmlcachegen::versionChecksForAheadOfTimeUnits()
QUrl("qrc:/data/versionchecks.qml"), &error);
QVERIFY(originalUnit);
QV4::CompiledData::Unit *tweakedUnit = (QV4::CompiledData::Unit *)malloc(originalUnit->qmlData->unitSize);
- memcpy(reinterpret_cast<void *>(tweakedUnit), reinterpret_cast<const void *>(originalUnit), originalUnit->qmlData->unitSize);
+ memcpy(reinterpret_cast<void *>(tweakedUnit),
+ reinterpret_cast<const void *>(originalUnit->qmlData),
+ originalUnit->qmlData->unitSize);
tweakedUnit->version = QV4_DATA_STRUCTURE_VERSION - 1;
temporaryModifiedCachedUnit = new QQmlPrivate::CachedQmlUnit{tweakedUnit, nullptr, nullptr};