[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-4.0] test qgraph.c: Fix segs due to out of s
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-4.0] test qgraph.c: Fix segs due to out of scope default |
Date: |
Fri, 5 Apr 2019 14:30:39 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 4/5/19 1:40 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> 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 fedora 30's gcc 9).
>
> Fixes: fc281c802022cb3a73a5
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> tests/libqos/qgraph.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Fixing it for 4.0 would be nice (we can't promise that everything in 4.0
is clean for gcc 9, but as long as we have to do -rc3 anyways, fixing
undefined behavior into something well-defined like this seems reasonable)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature