From 722d59c14cd0a82a0373fb305d0157f5281c076e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 14 Aug 2019 23:09:52 +0200 Subject: 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. --- girepository/gistructinfo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'girepository') diff --git a/girepository/gistructinfo.c b/girepository/gistructinfo.c index 7db417fc..a1edfa9f 100644 --- a/girepository/gistructinfo.c +++ b/girepository/gistructinfo.c @@ -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); } -- cgit v1.2.1