From 2ac1870053370e017567ae53e62cd1155a01c88f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 22 Mar 2021 09:28:28 +0100 Subject: shiboken6: Fix crash when using enumeration types from other classes qtbase/969337bcfd6af6d91b988e4b412703274a0b5877 changed QHostAddress to use enum values from QAbstractSocket which appear as fields. This caused a crash in the module initialization since QAbstractSocket was not initialized when creating the field entries. Consider this in the dependency calculation. Pick-to: 6.0 Pick-to: 5.15 Change-Id: Ie07dd39a373695cd604d0ebcf233be34a004c8bc Reviewed-by: Maximilian Goldstein Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sources') diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp index 73e974386..8e83a2df4 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp @@ -3067,8 +3067,11 @@ AbstractMetaClassList AbstractMetaBuilderPrivate::classesTopologicalSorted(const } // Member fields need to be initialized for (const AbstractMetaField &field : clazz->fields()) { - addClassDependency(classList, field.type().typeEntry(), - clazz, &graph); + auto typeEntry = field.type().typeEntry(); + if (typeEntry->isEnum()) // Enum defined in class? + typeEntry = typeEntry->parent(); + if (typeEntry != nullptr) + addClassDependency(classList, typeEntry, clazz, &graph); } } -- cgit v1.2.3