[Mono-list] Re: mono_string_null(NULL)

Paolo Molaro lupus@ximian.com
Wed, 9 Jan 2002 14:50:00 +0100

On 01/09/02 Matt Kimball wrote:
> > > * object.c: mono_string_new should return a NULL when the string
> > > passed in is NULL -- not try to deference it.
> > 
> > I don't agree with this change: it will hide bugs in the code.
> Would it be better for to revert that change, and write a wrapper around
> mono_string_new() which checks for NULLs, and use that wrapper in
> arch/x86/tramp.c?  (And, that way mono_string_new() would still throw an
> exception on NULL).

In tramp.c you will need some sort of wrapper anyway, since
mono_string_new () works for utf8 only, while a P/Invoke call
can return strings in any encoding and you will need to handle
that. So I'd revert the object.c patch and handle the issue in tramp.c


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better