qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] qobject-input-visitor: Catch misuse of end_


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 4/4] qobject-input-visitor: Catch misuse of end_struct vs. end_list
Date: Thu, 27 Apr 2017 08:13:13 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0

On 04/27/2017 06:50 AM, Markus Armbruster wrote:

>>>>
>>>> It would be more obvious with a check for qobject_type(tos->obj), no?
>>>
>>> --verbose?
>>>
>>
>> Instead of assert(tos->h) assert(qobject_type(tos->obj) == QTYPE_QDICT) ?
> 
> The two conditions imply each other.  We can assert either one, or even
> both.  Eric, got a preference?

Asserting both might make it easier to come up to speed when reading the
code a year from now.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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