[PATCH spice-common 6/7] codegen: Check wrong attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@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@xxxxxxxxxx>
---
 python_modules/demarshal.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 68532a9..50cf6c4 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -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 array or int8/uint8")
         writer.statement("memcpy(%s, in, %s)" % (array_start, nelements))
         writer.increment("in", nelements)
         if at_end:
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]