mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-26 05:26:09 +00:00
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.
This commit is contained in:
parent
5d02123499
commit
71faf12d81
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user