get_expr can return many things, depending on where it is used. In the outer parsing loop, we expect and require it to return an object.
Signed-off-by: John Snow <js...@redhat.com> --- scripts/qapi/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 6774b6c736..1bc33e85ea 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -94,6 +94,9 @@ def _parse(self): continue expr = self.get_expr(False) + if not isinstance(expr, dict): + raise QAPISemError(info, "Expecting object statement") + if 'include' in expr: self.reject_expr_doc(cur_doc) if len(expr) != 1: -- 2.26.2