mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-14 06:20:56 +02:00
structinfo: Fix offset in find_method()
The current offset only considers the fields themselves, but not the optional embedded type that may follow each field. Use the existing helper function instead of computing the offset to fix the issue.
This commit is contained in:
@ -215,12 +215,9 @@ g_struct_info_find_method (GIStructInfo *info,
|
|||||||
{
|
{
|
||||||
gint offset;
|
gint offset;
|
||||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||||
Header *header = (Header *)rinfo->typelib->data;
|
|
||||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||||
|
|
||||||
offset = rinfo->offset + header->struct_blob_size
|
offset = g_struct_get_field_offset (info, blob->n_fields);
|
||||||
+ blob->n_fields * header->field_blob_size;
|
|
||||||
|
|
||||||
return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user