nih-dbus-tool generates invalid c code for structure types

Bug #803587 reported by James Hunt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnih
In Progress
Undecided
Unassigned

Bug Description

A method specifying an array of structs will generate invalid C code. In XML:

<method name="foo">
<arg name="bar" type="a(sa(s)a(s))" direction="out" />
</method>

Revision history for this message
Scott James Remnant (scott) wrote :

This is caused by a bug in the code; instead of adding the structure definitions to a temporary "item_structs" list, then copying it to "structs" it was simply adding them directly to "structs".

The problem with that was that they were "local" variables and freed on returning from the function, cleanly removed from that linked list in the process. The temporary list and copy added the reference to make them non-local.

In the process also fixed a second bug where the structure definitions were added *after* their parent, not before.

Changed in libnih:
status: New → In Progress
Revision history for this message
Scott James Remnant (scott) wrote :
Revision history for this message
Scott James Remnant (scott) wrote :

attached fix, James will write tests

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.