From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: jsnow@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] qapi: Fix crash on missing enum member name
Date: Wed, 16 Jun 2021 07:25:34 -0500 [thread overview]
Message-ID: <20210616122534.s32a353aedwrll2y@redhat.com> (raw)
In-Reply-To: <20210616072121.626431-1-armbru@redhat.com>
On Wed, Jun 16, 2021 at 09:21:21AM +0200, Markus Armbruster wrote:
> New test case enum-dict-no-name.json crashes:
>
> $ python3 scripts/qapi-gen.py tests/qapi-schema/enum-dict-no-name.json
> Traceback (most recent call last):
> [...]
> File "/work/armbru/qemu/scripts/qapi/expr.py", line 458, in check_enum
> member_name = member['name']
> KeyError: 'name'
>
> Root cause: we try to retrieve member 'name' before we check for
> missing members. With that fixed, we get the expected error "'data'
> member misses key 'name'".
>
> Fixes: 0825f62c842f2c07c5471391c6d7fd3f4fe83732
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2021-06-16 12:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-16 7:21 [PATCH] qapi: Fix crash on missing enum member name Markus Armbruster
2021-06-16 12:25 ` Eric Blake [this message]
2021-06-16 16:47 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210616122534.s32a353aedwrll2y@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).