summaryrefslogtreecommitdiffstats
path: root/python_modules
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-03-02 13:42:10 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-03-05 18:19:07 +0100
commitf0ff2e383efba62e4f0368facd855d54ae915821 (patch)
tree905f32bc3b0f4c726a25aebd9c345157833e1eb8 /python_modules
parent15808ea7f5f1246e738b9fce064aeabe45851c0e (diff)
downloadspice-f0ff2e383efba62e4f0368facd855d54ae915821.tar.gz
spice-f0ff2e383efba62e4f0368facd855d54ae915821.tar.xz
spice-f0ff2e383efba62e4f0368facd855d54ae915821.zip
demarshal: fixed-size array are missing __nelements
A message with a fixed-size array, such as uint8 uuid[16] will generate an invalid code, missing the __nelements variable. Make sure that variable is defined.
Diffstat (limited to 'python_modules')
-rw-r--r--python_modules/demarshal.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 3a0178ed..541735a5 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -664,7 +664,7 @@ def read_array_len(writer, prefix, array, dest, scope, is_ptr):
nelements = "%s__array__nelements" % prefix
else:
nelements = "%s__nelements" % prefix
- if dest.is_toplevel():
+ if dest.is_toplevel() and scope.variable_defined(nelements):
return nelements # Already there for toplevel, need not recalculate
element_type = array.element_type
scope.variable_def("uint32_t", nelements)