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 706888 - gtype: fix a no-op assertion
gtype: fix a no-op assertion
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-08-27 13:42 UTC by Dan Winship
Modified: 2013-08-27 15:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtype: fix a no-op assertion (2.03 KB, patch)
2013-08-27 13:42 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2013-08-27 13:42:24 UTC
g_type_class_add_private() was doing

    g_assert (node->data->instance.private_size <= 0xffff);

but that field is a guint16, so the check was a no-op. (Noticed by
clang, but not gcc for some reason.) Fix it to do the math in a gssize
variable and do the bounds checking there before updating the struct
field.
Comment 1 Dan Winship 2013-08-27 13:42:25 UTC
Created attachment 253245 [details] [review]
gtype: fix a no-op assertion
Comment 2 Colin Walters 2013-08-27 13:52:00 UTC
Review of attachment 253245 [details] [review]:

Looks correct.
Comment 3 Dan Winship 2013-08-27 15:01:14 UTC
Attachment 253245 [details] pushed as 34e1a53 - gtype: fix a no-op assertion