After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719865 - object: Don't try to poke at a vfunc pointer in a class that doesn't have it
object: Don't try to poke at a vfunc pointer in a class that doesn't have it
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-04 20:12 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-12-04 20:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
object: Don't try to poke at a vfunc pointer in a class that doesn't have it (2.53 KB, patch)
2013-12-04 20:12 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-12-04 20:12:21 UTC
See patch. Spotted by Lionel Landwerlin.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-12-04 20:12:23 UTC
Created attachment 263529 [details] [review]
object: Don't try to poke at a vfunc pointer in a class that doesn't have it

If a class introduces the vfunc, then we don't have a parent to compare
it against to check see it's unchanged, and we know it isn't.

This prevents poking in invalid memory and causing valgrind to spew
and potentially a crash.
Comment 2 Colin Walters 2013-12-04 20:17:36 UTC
Review of attachment 263529 [details] [review]:

Only a minor naming comment, feel free to commit with or without change.

::: gi/object.cpp
@@ +397,3 @@
+find_vfunc_on_parents(GIObjectInfo *info,
+                      gchar        *name,
+                      gboolean     *out_is_on_us)

*out_defined_by_parent ?  "is_on_us" feels awkward.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-12-04 20:20:01 UTC
Attachment 263529 [details] pushed as 3076907 - object: Don't try to poke at a vfunc pointer in a class that doesn't have it


Pushed with the name change.