[Mono-dev] Re: Regressions in generics runtime support

Raja R Harinath rharinath at novell.com
Mon Feb 20 04:39:09 EST 2006

Hi Kamil,

"Kamil Skalski" <kamil.skalski at gmail.com> writes:

> I noticed a few refactorings of generics support in mono recently.
> Unfortunately there appeared some regressions.
> First one comes from patch
> http://lists.ximian.com/pipermail/mono-patches/2006-February/070865.html
> It causes following assertion when bootstraping Nemerle compiler:
> COMPILE [stage1] Nemerle.Compiler.dll
> ** ERROR **: file icall.c: line 1891
> (ves_icall_MonoType_GetGenericArguments): assertion failed: ((t->type
> != MONO_TYPE_VAR && t->type != MONO_TYPE_MVAR) ||
> t->data.generic_param->owner)
> (this problems seems present also in current svn version)
> Later it got even worse, since with current svn, mono states there is
> some invalid IL in Nemerle.Compiler. Though from what I can see this
> might be related to Paolo's changes in IL verification.
> Here is the tarball to reproduce the problems:
> http://nemerle.org/download/snapshots/nemerle-
> Hm, probably I should open a bug for this, as IL and generics problems
> are probably not related. What is your opinion?

I agree.  They're probably not related.  However, I couldn't even
configure the nemerle tree since it complains about invalid IL in the
bootstrap compiler.

The IL looks like:

        IL_04bd:  call !!0 class [Nemerle]Nemerle.Core.Option::UnSome<valuetype [Nemerle]Nemerle.Builtins.Tuple`2<class [Nemerle]Nemerle.Core.list`1<class Nemerle.Compiler.TyVar>,class Nemerle.Compiler.TyVar>> (class [Nemerle]Nemerle.Core.option`1<!!0>)
        IL_04c2:  ldfld  !0 valuetype [Nemerle]Nemerle.Builtins.Tuple`2<class [Nemerle]Nemerle.Core.list`1<class Nemerle.Compiler.TyVar>,class Nemerle.Compiler.TyVar>::field0

The 'call' puts a valuetype on the stack, which mono's il-verifier for
'ldfld' doesn't like.  The ECMA 335 April 2005 draft says that it should
be allowed -- maybe this is a change from the older ECMA standard?

So, yes, you should file a bug :-)

- Hari

More information about the Mono-devel-list mailing list