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

Bug #803587 reported by James Hunt on 2011-06-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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" />

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
Scott James Remnant (scott) wrote :
Scott James Remnant (scott) wrote :

attached fix, James will write tests

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

Other bug subscribers