[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 46/56] json: Assert json_parser_parse() consumes

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 46/56] json: Assert json_parser_parse() consumes all tokens on success
Date: Thu, 16 Aug 2018 08:13:46 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 08/08/2018 07:03 AM, Markus Armbruster wrote:
Signed-off-by: Markus Armbruster <address@hidden>
  qobject/json-parser.c | 1 +
  1 file changed, 1 insertion(+)

Straight-forward, but took a lot of cleanup in earlier patches to get here ;)

Reviewed-by: Eric Blake <address@hidden>

diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index c2974d46b3..208dffc96c 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -539,6 +539,7 @@ QObject *json_parser_parse(GQueue *tokens, va_list *ap, 
Error **errp)
      QObject *result;
result = parse_value(&ctxt, ap);
+    assert(ctxt.err || g_queue_is_empty(ctxt.buf));
error_propagate(errp, ctxt.err);

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

reply via email to

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