Skip to content
Commit caeeeb7e authored by Martin Pitt's avatar Martin Pitt
Browse files

Fix signedness, overflow checking, and 32 bit overflow of GFlags

GFlagsValue.value is a guint, so we must access it as unsigned type. Define two
new macros PYGLIB_PyLong_FromUnsignedLong() and PYGLIB_PyLong_AsUnsignedLong()
for that purpose, and consistently use them for handling flag values. Use the
checked variant of these functions which produce OverflowErrors instead
of the unchecked PYGLIB_PyLong_AS_LONG().

Insert zero padding after the PyLongObject in PyGFlags and PyGEnum. Without
this, the directly adjacent GType field seems to confuse
PyLong_FromUnsignedLong() and includes the GType into the numeric value.

https://bugzilla.gnome.org/show_bug.cgi?id=693121
parent b3a3da37
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment