Andrew Cooper writes ("[PATCH for-4.6 2/8] tools/libxl: Assert that 
libxl__ao_inprogress_gc() is not called with NULL"):
> libxl__ao_inprogress_gc() is hidden behind various macros used to
> construct local variables.  Assert() that NULL is not passed, to make
> such an error very obvious, rather than a plain segfault at 0.

I'm not in general a huge fan of this approach.  It can be unclear
where it ends: should every function that requires non-null arguments
assert all those arguments ?

But (a) libxl__ao_inprogress_gc is a special case because one of its
purposes is to check the state of the ao being dealt with and (b) the
assert may help prevent an optimiser (perhaps a whole program
optimiser) from doing something insane if it notices that a particular
path always passes ao==0.

So:

Acked-by: Ian Jackson <ian.jack...@eu.citrix.com>

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

Reply via email to