[Mono-bugs] [Bug 379348] gmcs generates code that crashes mono with delegates and generic types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 11 16:35:03 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=379348

User rkumpera at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=379348#c1





--- Comment #1 from Rodrigo Kumpera <rkumpera at novell.com>  2008-04-11 14:35:03 MST ---
Created an attachment (id=207576)
 --> (https://bugzilla.novell.com/attachment.cgi?id=207576)
Teste case

The attached test case will crash mono if compiled with gmcs, but will work
with csc. The difference between CSC and GMCS is in how the delegate is
constructed:

GMCS:
ldarg.0 
ldfld !0 class GenericClass`1<!0>::'field'
dup 
ldvirtftn instance string class [mscorlib]System.IFormattable::ToString(string,
class [mscorlib]System.IFormatProvider)
newobj instance void class ToStr::'.ctor'(object, native int)


CSC:
ldarg.0 
ldfld !0 class GenericClass`1<!0>::'field'
box !0 //<<<------
dup 
ldvirtftn instance string class [mscorlib]System.IFormattable::ToString(string,
class [mscorlib]System.IFormatProvider)
newobj instance void class ToStr::'.ctor'(object, native int)


Note that this extra box is completely harmless to performance for the
reference type expansion, as it must be a nop.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list