mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-07 20:02:40 +00:00
codegen: Check wrong attribute
@ptr_array is supposed to change the destination to an array of pointer to items. This for a raw buffer does not make sense but check if user specifies this combination. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
7462c171e1
commit
a5de31bc8a
@ -810,6 +810,8 @@ def write_array_parser(writer, member, nelements, array, dest, scope):
|
||||
at_end = True
|
||||
|
||||
if element_type == ptypes.uint8 or element_type == ptypes.int8:
|
||||
if array.has_attr("ptr_array"):
|
||||
raise Exception("Attribute ptr_array not supported for arrays of int8/uint8")
|
||||
writer.statement("memcpy(%s, in, %s)" % (array_start, nelements))
|
||||
writer.increment("in", nelements)
|
||||
if at_end:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user