mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 19:40:58 +00:00
qapi: Fix errors for non-string, non-dictionary members
Backports commit c6b71e5ae73802057d700e2419b80aef1651f213 from qemu
This commit is contained in:
parent
16619a738e
commit
630b56b4a2
|
@ -462,13 +462,14 @@ def check_type(expr_info, source, value, allow_array = False,
|
|||
% (source, all_names[value], orig_value))
|
||||
return
|
||||
|
||||
# value is a dictionary, check that each member is okay
|
||||
if not isinstance(value, OrderedDict):
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a dictionary" % source)
|
||||
if not allow_dict:
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a type name" % source)
|
||||
if not isinstance(value, OrderedDict):
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a dictionary or type name" % source)
|
||||
|
||||
# value is a dictionary, check that each member is okay
|
||||
for (key, arg) in value.items():
|
||||
check_name(expr_info, "Member of %s" % source, key,
|
||||
allow_optional=allow_optional)
|
||||
|
|
Loading…
Reference in a new issue