mirror of https://gitee.com/openkylin/qemu.git
qapi: add assert about root value
qiv->root should not be null, make that clearer with some assert. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20160930095948.3154-2-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
bce3035a44
commit
5d0cbbcfeb
|
@ -64,6 +64,7 @@ static QObject *qmp_input_get_object(QmpInputVisitor *qiv,
|
|||
|
||||
if (QSLIST_EMPTY(&qiv->stack)) {
|
||||
/* Starting at root, name is ignored. */
|
||||
assert(qiv->root);
|
||||
return qiv->root;
|
||||
}
|
||||
|
||||
|
@ -395,6 +396,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict)
|
|||
{
|
||||
QmpInputVisitor *v;
|
||||
|
||||
assert(obj);
|
||||
v = g_malloc0(sizeof(*v));
|
||||
|
||||
v->visitor.type = VISITOR_INPUT;
|
||||
|
|
Loading…
Reference in New Issue