GNOME Bugzilla – Bug 709456
Calling g_base_info_get_name on GI_INFO_TYPE_TYPE causes segfault
Last modified: 2018-02-08 12:24:38 UTC
g_base_info_get_name uses a switch statement to dispatch based on the GITypeInfo of the object. In the case of GI_INFO_TYPE_TYPE, it is combined with the default case which uses g_assert_not_reached(). This seems like it breaks the object oriented conceptual model for the classes. I think any valid type should return something (even NULL). https://git.gnome.org/browse/gobject-introspection/tree/girepository/gibaseinfo.c?h=gnome-3-0#n365
(In reply to comment #0) > I think any valid type should return something (even NULL). g_base_info_get_name is even already documented to return "or %NULL if it lacks a name": https://git.gnome.org/browse/gobject-introspection/tree/girepository/gibaseinfo.c#n284
Created attachment 279074 [details] [review] patch to gibaseinfo.c Returns NULL when encountering a TYPE. This isn't quite the correct thing to do, but is a good stop gap measure.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
I was just going to submit this same patch. What would be the "correct" thing to do?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/96.