[Spice-devel] [PATCH spice-common 6/7] codegen: Check wrong attribute
Christophe Fergeau
cfergeau at redhat.com
Wed Feb 20 16:49:12 UTC 2019
On Mon, Feb 18, 2019 at 04:01:28PM +0000, Frediano Ziglio wrote:
> @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 at redhat.com>
> ---
> 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")
"for arrays of 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190220/56096b49/attachment.sig>
More information about the Spice-devel
mailing list