summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2018-06-21 22:55:08 +0100
committerFrediano Ziglio <fziglio@redhat.com>2018-06-27 21:44:19 +0100
commitbc9df5816210efbe15ca03e82510f34174784082 (patch)
tree09f2be30ec08a05e163a491a6b20f1d083eee4ab
parent1378d5cfc4751afba401d30c9dd38a561fa39297 (diff)
marshal: Fix a bug with zero attribute
If this attribute was specified during marshaller the field was marshalled twice. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
-rw-r--r--python_modules/marshal.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index fd3416a..94ff055 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -321,7 +321,7 @@ def write_member_marshaller(writer, container, member, src, scope):
elif t.is_primitive():
if member.has_attr("zero"):
writer.statement("spice_marshaller_add_%s(m, 0)" % (t.primitive_type()))
- if member.has_attr("bytes_count"):
+ elif member.has_attr("bytes_count"):
var = "%s__ref" % member.name
scope.variable_def("void *", var)
writer.statement("%s = spice_marshaller_add_%s(m, %s)" % (var, t.primitive_type(), 0))