[Mono-list] ldtoken with ByRef, question

Rodrigo Kumpera kumpera at gmail.com
Sat Nov 22 18:14:22 EST 2008


I mean't to say a typespec. Just take a look at P II 23.2.14, no way to
encode byref with it.



On Sat, Nov 22, 2008 at 12:51 PM, Jeroen Frijters <jeroen at sumatra.nl> wrote:

> With a typespec you can.
>
> > -----Original Message-----
> > From: Rodrigo Kumpera [mailto:kumpera at gmail.com]
> > Sent: Saturday, November 22, 2008 15:48
> > To: Jeroen Frijters
> > Cc: DraconisBG; mono-list at lists.ximian.com
> > Subject: Re: [Mono-list] ldtoken with ByRef, question
> >
> > Well, with a methodspec you can encode pointers and custom modifiers,
> > but not byref.
> >
> >
> >
> >
> > On Sat, Nov 22, 2008 at 6:52 AM, Jeroen Frijters <jeroen at sumatra.nl>
> > wrote:
> >
> >
> >       Rodrigo Kumpera wrote:
> >       > As you have found out ldtoken can only reference types and not
> > type
> >       > signatures.
> >
> >
> >       Not true. Spec says:
> >
> >       "The token shall be one of:
> >       A methoddef, methodref or methodspec: pushes a
> > RuntimeMethodHandle
> >       A typedef, typeref, or typespec : pushes a RuntimeTypeHandle
> >       A fielddef or fieldref : pushes a RuntimeFieldHandle"
> >
> >       Now, .NET reflection won't allow
> > ILGenerator.Emit(OpCodes.Ldtoken, typeof(xxx).MakeByRefType()), but if
> > you create the IL in another way (e.g. by using my non-broken
> > IKVM.Reflection.Emit implementation ;-)) you get perfectly valid IL.
> >
> >       Regards,
> >       Jeroen
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20081122/4b255ee4/attachment.html 


More information about the Mono-list mailing list