GNOME Bugzilla – Bug 563469
Arrays not treated correctly in struct offset calculation
Last modified: 2015-02-07 16:54:43 UTC
Arrays are currently not handled specially, and hence treated as pointers in giroffsets.c:get_field_size_alignment(), which is (obviously) wrong.
Is the subject here constant length arrays? Is the length of such arrays in the scanner information?
Created attachment 124060 [details] [review] Fixes offset calculation for arrays
Created attachment 125679 [details] [review] Fixes array offset calculation Rebased patch against SVN r996.
I'm not too familiar with this code. Owen, could you help out here?
It looks pretty good to me. The only thing I am wondering about - is type->is_pointer && type->tag == GI_TYPE_TAG_ARRAY possible? How would a guchar** (strv) in a structure be represented?
(In reply to comment #5) > It looks pretty good to me. > > The only thing I am wondering about - is > > type->is_pointer && type->tag == GI_TYPE_TAG_ARRAY > > possible? How would a guchar** (strv) in a structure be represented? > AFAICT, this case is not currently handled by the scanner, you get just a plain "any" as type in the GIR for pointer-to-pointer types, but that's a least correct wrt. alignment and offsets. I'd say this (lack of proper type info in GIR/typelib for pointer-to-pointer types) is a different bug.
Applied, thank you! pointer-to-pointer is something we need to figure out for correct support for some unions and more, but this patch looks good as is.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]