[Mono-dev] inline_method doesn't clean loader erros

Rodrigo Kumpera kumpera at gmail.com
Mon Dec 31 15:28:43 EST 2007


While testing my last commit to mono I found a quite odd situation. What
happens is that once a method been inlined
and it fails due to a loader error, this error won't be clean up and it
could cause unwanted errors in mono_method_to_ir if it call mono_class_init.

The test I added, test/invalid-token.il, can be used to reproduce this
situation. Uncommenting the lines in Main will trigger this error.
At first it will crash since BadImageFormatException is not expected as a
class loading error. The attached patch fixes that.
After applying it, the code will die with a BadImageFormatException been
reported for System.Console.

This happens because the inlining of InvalidMethodDef() fails but leaves a
pending loader error (the BadImageFormatException), which is later consumed
by mono_class_init
when it called later by mono_method_to_ir.

What I'm not sure here is which part of the code is responsible for
consuming the loader error. Anyone could give me some light on that subject?
As this requires some fixing.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071231/2d7b284e/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad_img.diff
Type: text/x-patch
Size: 519 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071231/2d7b284e/attachment.bin 

More information about the Mono-devel-list mailing list