gtype: fix a no-op assertion
authorDan Winship <danw@gnome.org>
Tue, 27 Aug 2013 13:40:18 +0000 (09:40 -0400)
committerDan Winship <danw@gnome.org>
Tue, 27 Aug 2013 13:42:14 +0000 (09:42 -0400)
commit34e1a537956e85d9d2db2127cd723a6c7456f793
tree365b69c1c12cd9f99b703794409a7fe41122d33f
parentca4f6ba855fe0a18d8135e8379bec03e60b88f89
gtype: fix a no-op assertion

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.

https://bugzilla.gnome.org/show_bug.cgi?id=706888
gobject/gtype.c