Skip to content
Commit f4d858c0 authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Christoph Reiter
Browse files

Fix list/hashtable enum <-> hash conversion on 64-bit big endian

glist and ghashtable objects both store pointers. Complex objects are
stored as pointers to the objects, but simpler objects like an integer
value are stored directly as a pointer, using for example the
GINT_TO_POINTER and GPOINTER_TO_INT macros.

This is done in pygobject with the _pygi_hash_pointer_to_arg and
_pygi_arg_to_hash_pointer functions. These functions handle the various
type of objects. However they consider that an enum, represented with the
GI_TYPE_TAG_INTERFACE type (extended interface object), are always a
pointer. This is wrong as it is often a 32-bit value. Therefore on 64-bit
big endian machines, the value is handle with the 2 32-bit parts swapped.

This patches fixes that by changing the second argument of both functions
from GITypeTag to GITypeInfo. This way the interface can be determined,
and the underlying storage type can also be determined. This currently
only handles enum and flags, leaving other types as pointers....
parent 1cb6c470
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