From: Markus Armbruster Date: Thu, 23 Aug 2018 16:40:13 +0000 (+0200) Subject: json: Assert json_parser_parse() consumes all tokens on success X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5d50113cf675ec96337ac6eaf81d83fbf69273bc;p=qemu.git json: Assert json_parser_parse() consumes all tokens on success Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-47-armbru@redhat.com> --- diff --git a/qobject/json-parser.c b/qobject/json-parser.c index e3ee2a273a..685e9dac24 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -544,6 +544,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);