mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 22:15:28 +00:00
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:
parent
1a138915a5
commit
bd469af15f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue