Received: from eggs.gnu.org ([2001:4830:134:3::10]:34445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnqp-00024U-Eu for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmnqn-0001Ag-Gn for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:10:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnqn-0001AW-9Z for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:10:37 -0400 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 22 Sep 2016 00:10:15 +0400 Message-Id: <20160921201018.20957-2-marcandre.lureau@redhat.com> In-Reply-To: <20160921201018.20957-1-marcandre.lureau@redhat.com> References: <20160921201018.20957-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 1/4] qapi: add assert about root value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: berto@igalia.com, eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= qiv->root should not be null, make that clearer with some assert. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/qmp-input-visitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c index 64dd392..be52aaf 100644 --- a/qapi/qmp-input-visitor.c +++ b/qapi/qmp-input-visitor.c @@ -64,6 +64,7 @@ static QObject *qmp_input_get_object(QmpInputVisitor *q= iv, =20 if (QSLIST_EMPTY(&qiv->stack)) { /* Starting at root, name is ignored. */ + assert(qiv->root); return qiv->root; } =20 @@ -384,6 +385,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool str= ict) { QmpInputVisitor *v; =20 + assert(obj); v =3D g_malloc0(sizeof(*v)); =20 v->visitor.type =3D VISITOR_INPUT; --=20 2.10.0