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

Re: [Xen-devel] [PATCH] tools: libxl: testidl: initialise the KeyedUnion keyvar before the union



On 04/12/13 17:48, Ian Campbell wrote:
> This is Coverity CID 1135378 and 1135379.
>
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

This sound plausible, although given my unfamiliarity with gentest.py, I
dont feel as if a Reviewed-by tag is appropriate.

~Andrew

> ---
>  tools/libxl/gentest.py |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
> index 6fab493..722b7f4 100644
> --- a/tools/libxl/gentest.py
> +++ b/tools/libxl/gentest.py
> @@ -42,6 +42,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
>      elif isinstance(ty, idl.KeyedUnion):
>          if parent is None:
>              raise Exception("KeyedUnion type must have a parent")
> +        s += gen_rand_init(ty.keyvar.type, parent + ty.keyvar.name, indent, 
> parent)
>          s += "switch (%s) {\n" % (parent + ty.keyvar.name)
>          for f in ty.fields:
>              (nparent,fexpr) = ty.member(v, f, parent is None)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.