[Mono-dev] Having trouble getting tail. callvirt to work
Zoltan Varga
vargaz at gmail.com
Sun Nov 14 07:10:31 EST 2010
Hi,
Mono's tail call implementation has some limitations, so it is simply
turned off in some cases like this one.
Zoltan
On Sun, Nov 14, 2010 at 9:31 AM, Stefan O'Rear <stefanor at cox.net> wrote:
> The following small CIL demo blows the stack on Mono 2.9/78b8d38 with
> both the LLVM and integrated JIT backends. What am I doing wrong?
>
> If callvirt is replaced with call, the program runs in constant stack
> space. If callvirt is replaced with calli (passing in the ldftn value
> as a parameter), the program fails exactly as it does for callvirt.
>
> -Stefan
>
> .assembly extern mscorlib {}
>
> .assembly 'test' { }
>
> .class public auto C
> {
> .method public hidebysig specialname rtspecialname
> instance default void '.ctor' () cil managed
> {
> .maxstack 8
> ldarg.0
> call instance void class [mscorlib]System.Object::'.ctor'()
> ret
> }
>
> .method public virtual instance void Fun()
> {
> ldarg.0
> tail.
> callvirt instance void class C::Fun()
> ret
> }
> }
>
> .method static public void main() cil managed
> {
> .entrypoint
> .maxstack 1
> newobj instance void class C::'.ctor'()
> callvirt instance void class C::Fun()
> ret
> }
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkzfnmkACgkQFBz7OZ2P+dIYrACfYa8wJhuwg4qz0MZXne6dHrmu
> meMAnAms/hVuAlo6KOIs8PIcTHfzLjGS
> =q7Wq
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101114/7477cdd5/attachment.html
More information about the Mono-devel-list
mailing list