mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-24 10:11:02 +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)) {
|
if (QSLIST_EMPTY(&qiv->stack)) {
|
||||||
/* Starting at root, name is ignored. */
|
/* Starting at root, name is ignored. */
|
||||||
|
assert(qiv->root);
|
||||||
return qiv->root;
|
return qiv->root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,6 +399,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict)
|
||||||
{
|
{
|
||||||
QmpInputVisitor *v;
|
QmpInputVisitor *v;
|
||||||
|
|
||||||
|
assert(obj);
|
||||||
v = g_malloc0(sizeof(*v));
|
v = g_malloc0(sizeof(*v));
|
||||||
|
|
||||||
v->visitor.type = VISITOR_INPUT;
|
v->visitor.type = VISITOR_INPUT;
|
||||||
|
|
Loading…
Reference in a new issue