[Mono-dev] [PATCH] Handle more gracefully invalid generic instantiations

Rodrigo Kumpera kumpera at gmail.com
Fri Jun 26 11:11:00 EDT 2009


The attached patch changes class.c/inflate_generic_type to not abort the
runtime when facing a bad instantiation.

My only issue is that I'm not sure if mono_class_inflate_generic_type* and
mono_class_inflate_generic_class should
set a loader error when returning null. I don't think this is necessary as
this is something their callers should do. But maybe
mono_class_inflate_generic_method_full should.

This patch doesn't fix the whole thing as an audit of all callers of
mono_class_inflate_generic_type(_with_mempool | _no_copy)
and mono_class_inflate_generic_class are required to property handle them
returning NULL.

I got some local tests for these errors, but they are not in good shape for
been part of this patch.

Please review,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090626/ebbc8d5e/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inflate_error.diff
Type: text/x-patch
Size: 10070 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090626/ebbc8d5e/attachment.bin 

More information about the Mono-devel-list mailing list