summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer/gui
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-19 13:04:39 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-05-31 17:08:11 +0200
commit33a2bd9ca9ee3dc05e5f7cb48aa8f1d55f5368b2 (patch)
tree5a9031d618a17d39e6615089f131d76865c8db42 /tests/libfuzzer/gui
parentbf0b2b24a7d04f5926dfc6b8431ebbbe51df7264 (diff)
Q_DECLARE_METATYPE: Do not re-register types
When Q_DECLARE_METATYPE is used, we often end up re-registering types as typedefs of themselves. This is because with Q_DECLARE_METATYPE, we set a legacy register operation which calls (after some indirection) QMetaType::registerNormalizedType. We still need to support this to preserve compatibility in the presence of typedefs and namespaced types. However, there is no reason to do the wasteful work of normalizing the typename at runtime and adding memory overhead to have a type registered as a typedef of itself. We can skip the type normalization work by checking whether the name in the metatype interface equals that of the typename. We still need to make sure that the converter and view functions are registered, though. Moreover, we can fix the check in qRegisterNormalizedMetaType to only call registerNormalizedTypedef if the new name doesn't match the name stored in the metatype. Fixes: QTBUG-93841 Change-Id: Icfe42c349b23add630fe3c761362b60e9e9aaa2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/libfuzzer/gui')
0 files changed, 0 insertions, 0 deletions