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

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



This is Coverity CID 1135378 and 1135379.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 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)
-- 
1.7.10.4


_______________________________________________
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®.