mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01: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:
parent
8958f167bf
commit
e0f9f94a7e
@ -215,12 +215,9 @@ g_struct_info_find_method (GIStructInfo *info,
|
||||
{
|
||||
gint offset;
|
||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||
Header *header = (Header *)rinfo->typelib->data;
|
||||
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
|
||||
|
||||
offset = rinfo->offset + header->struct_blob_size
|
||||
+ blob->n_fields * header->field_blob_size;
|
||||
|
||||
offset = g_struct_get_field_offset (info, blob->n_fields);
|
||||
return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user