qapi: add assert about root value

qiv->root should not be null, make that clearer with some assert.

Backports commit 5d0cbbcfeb59e1e3f5ee7d26b8a215382f6d9abd from qemu
This commit is contained in:
Marc-André Lureau 2018-02-26 05:15:00 -05:00 committed by Lioncash
parent 1a138915a5
commit bd469af15f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -63,6 +63,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;
}
@ -398,6 +399,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict)
{
QmpInputVisitor *v;
assert(obj);
v = g_malloc0(sizeof(*v));
v->visitor.type = VISITOR_INPUT;