From 306ca05c5e681c6a842e9b6ed35c9f9f77186baf Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 2 Feb 2009 16:31:06 +0000 Subject: [PATCH] Bug 569408, Bug 568680 - Scanner misses fields (at least in GObject.Object) The scanner misses all fields of the GObject struct -- there are no children of the element for GObject in the GIR. This of course yields wrong field offsets for all derived objects. svn path=/trunk/; revision=1079 --- giroffsets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/giroffsets.c b/giroffsets.c index f224e6931..cc56d0bc8 100644 --- a/giroffsets.c +++ b/giroffsets.c @@ -357,8 +357,9 @@ compute_struct_field_offsets (GIrNode *node, } else if (member->type == G_IR_NODE_CALLBACK) { - size = ffi_type_pointer.size; - alignment = ffi_type_pointer.alignment; + size = ALIGN (size, ffi_type_pointer.alignment); + alignment = MAX (alignment, ffi_type_pointer.alignment); + size += ffi_type_pointer.size; } }