[4/5] widl: Rewrite of cant_be_null
Michael Karcher
wine at mkarcher.dialup.fu-berlin.de
Sun Jan 11 08:02:23 CST 2009
As Rob Shearman commented to my patch "Null-check pointers with [size_is]",
the code flow in cant_be_null is non-obvious, the variable type check could
be included into this function and last but not least it is buggy. This
is a hopefully cleaner rewrite of this function, which still fixes the
problem the original patch intended to fix, namely null-checking of pointers
declared with size_is. This matches midl behaviour. In
void test1([out,size_is(x)] char str[], [in] int x);
void test2([size_is(x), out] char* str, [in] int x);
the parameter to test1 is not NULL-checked, but the one to test2 is.
The function was renamed to needs_null_pointer_check, as the name
cant_be_null does not make sense to me anymore if the type passed in to
the function is not meant to be a pointer, but anything.
This patch also includes the functionality change from "widl: use base
pointer type instead of default if not overwritten. (resend)", which is
obsoleted by rewriting cant_be_null.
---
tools/widl/client.c | 2 +-
tools/widl/proxy.c | 50 +++++++++++++++++++++++------------------------
tools/widl/widltypes.h | 2 +-
3 files changed, 26 insertions(+), 28 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 42747e91d058ebb2730fe7463d98a37117a1a64f.diff
Type: text/x-patch
Size: 3361 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090111/d27f1a88/attachment.bin
More information about the wine-patches
mailing list