[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v15 02/23] qapi: Guarantee NULL obj on input vis

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v15 02/23] qapi: Guarantee NULL obj on input visitor callback error
Date: Thu, 28 Apr 2016 09:41:44 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 04/28/2016 07:00 AM, Eric Blake wrote:
>> The commit message lists start_struct(), start_alternate(), next_list(),
>> type_str(), and type_any().  You cover them except for next_list().  Why
>> is that missing?
> Because *obj can be NULL after next_list() if the list is empty.  But
> there may still be a weaker assertion worth having: if err, then *obj
> must be NULL; and if *obj, then err must not be set (weaker in that for
> all the other functions touched, exactly one of the two conditions can
> result, but here, !err and !*obj is valid as a third condition).

Actually, because visit_next_list() can't fail (we removed the errp
argument earlier).  When we finally move the list head allocation into
visit_start_list later in the series (22/23), then we should add the
(weaker) assert there.

> Depending on what else you find later in the series, I may just post a
> fixup for this patch.

Still my plan.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]