After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 569633 - [PATCH] Typelib compiler fails with vararg callbacks.
[PATCH] Typelib compiler fails with vararg callbacks.
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-01-29 07:42 UTC by Robert Carr
Modified: 2015-02-07 16:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix problem (5.15 KB, patch)
2009-01-29 07:43 UTC, Robert Carr
needs-work Details | Review
Updated patch (6.88 KB, patch)
2009-02-07 09:41 UTC, Robert Carr
accepted-commit_now Details | Review

Description Robert Carr 2009-01-29 07:42:42 UTC
Please describe the problem:
The typelib compiler fails with NULL node when there is a vararg callback or a function expecting a vararg callback.

Attached is a patch to fix this by filtering them out as happens with other vararg functions.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Robert Carr 2009-01-29 07:43:10 UTC
Created attachment 127434 [details] [review]
Patch to fix problem
Comment 2 Johan (not receiving bugmail) Dahlin 2009-01-29 10:06:44 UTC
Thanks for the patch. Looks pretty good, however you need to run make check and update the tests (foo-1.0-expected.gir and foo-1.0-expected.tgir) as well.

I'd personally use a for(x=...;x;x=x->next) instead of that while, as you're iterating over a list. The function body is rather large as well, I'd also refactor it into at least one more function
Comment 3 Robert Carr 2009-02-07 09:41:37 UTC
Created attachment 128144 [details] [review]
Updated patch

I think this patch addresses your concerns. I didn't convert the iteration to a for loop, as due to where the iter->next and checking occurs, the most natural form for the loop expression, is not actually identical to the while loop (due to list deleting) (I know, it sounds strange, but is easily testable).
Comment 4 Colin Walters 2009-02-10 13:05:12 UTC
Minor inconsistent spacing:

+ g_list_free(varargs_callbacks);

But other than that looks great!
Comment 5 Colin Walters 2009-02-10 23:34:39 UTC
Forgot about the no gnome account yet.  Applied, thanks!
Comment 6 André Klapper 2015-02-07 16:54:46 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]