GNOME Bugzilla – Bug 633907
[PATCH] fix treatment of g_callable_get_n_args() return value
Last modified: 2010-11-11 17:30:52 UTC
g_callable_get_n_args() returns gint but libpeas treats the return value as guint in a few places. If introspection is somewhat broken (and thus the callable info that libpeas passes to g_callable_get_n_args() is NULL) then libpeas will execute a couple for-loops from 0 to GUINT_MAX due to the mistype. Patch attached that fixes that and a couple other issues I encountered. After the patch, there are still warnings, but peas does not crash: [dcbw@dcbw libpeas (master*)]$ gedit Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory ** (gedit:4056): WARNING **: Could not load Gedit repository: Typelib file for namespace 'Gedit', version '3.0' not found (gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditAppActivatable' (gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed (gedit:4056): libpeas-CRITICAL **: implement_interface_methods: assertion `iface_info != NULL' failed (gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditWindowActivatable' (gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed (gedit:4056): libpeas-CRITICAL **: implement_interface_methods: assertion `iface_info != NULL' failed (gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditWindowActivatable' (gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed (gedit:4056): libpeas-WARNING **: Type not found in introspection: 'GeditViewActivatable' (gedit:4056): libpeas-CRITICAL **: peas_extension_set_call_valist: assertion `callable_info != NULL' failed
Created attachment 173774 [details] [review] Fix handling of return value from g_callable_info_get_n_args
Review of attachment 173774 [details] [review]: This patch looks nice. You can push it but please fix the small style issue I pointed below. Thank you very much! ::: libpeas/peas-introspection.c @@ +38,3 @@ GIArgument *cur_arg; + g_return_if_fail (callable_info); Please use "callable_info != NULL" for consistency
Pushed as a2f98e51140286ff18a4442e2e7c39905afe40fb