On 9/24/19 8:28 AM, Markus Armbruster wrote:
> check_type() checks the array's contents, then peels off the array and
> falls through to the "not array" code without resetting allow_array
> and allow_dict to False.  Works because the peeled value is a string,
> and allow_array and allow_dict aren't used then.  Tidy up anyway:
> recurse instead, defaulting allow_array and allow_dict to False.
> 
> Signed-off-by: Markus Armbruster <arm...@redhat.com>
> ---
>  scripts/qapi/common.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <ebl...@redhat.com>

> 
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 5e708c3b45..07cf72e72c 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
> @@ -794,7 +794,8 @@ def check_type(value, info, source,
>              raise QAPISemError(info,
>                                 "%s: array type must contain single type 
> name" %
>                                 source)
> -        value = value[0]
> +        check_type(value[0], info, source, allow_metas=allow_metas)
> +        return
>  
>      # Check if type name for value is okay
>      if isinstance(value, str):
> 

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to