Re: [Qemu-devel] [PATCH] test qgraph.c: Fix segs due to out of scope default

2019-04-06 Thread Thomas Huth
On 05/04/2019 23.16, Paolo Bonzini wrote: > On 05/04/19 20:40, Dr. David Alan Gilbert (git) wrote: >> From: "Dr. David Alan Gilbert" >> >> The test uses the trick: >>if (!opts) { >> opts = &(QOSGraph...Options) { }; >>} >> >> in a couple of places, however the temporary created >> b

Re: [Qemu-devel] [PATCH] test qgraph.c: Fix segs due to out of scope default

2019-04-05 Thread Paolo Bonzini
On 05/04/19 20:40, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The test uses the trick: >if (!opts) { > opts = &(QOSGraph...Options) { }; >} > > in a couple of places, however the temporary created > by the &() {} goes out of scope at the bottom of th

[Qemu-devel] [PATCH] test qgraph.c: Fix segs due to out of scope default

2019-04-05 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The test uses the trick: if (!opts) { opts = &(QOSGraph...Options) { }; } in a couple of places, however the temporary created by the &() {} goes out of scope at the bottom of the if, and results in a seg or assert when opts-> fields are used (on fedo