Bug 448558 - gmcs emits unverifiable generic code
Summary: gmcs emits unverifiable generic code
Status: RESOLVED DUPLICATE of bug 324319
Alias: None
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: SVN
Hardware: Other Other
: P5 - None : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-25 10:12 UTC by Rolf Kvinge
Modified: 2008-11-25 16:56 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Kvinge 2008-11-25 10:12:20 UTC
Test sample:
class T {
        public P GetService <P> () where P : class
        {
            return null;
        }
}

gmcs il:
.method public hidebysig instance !!P GetService<class P>() cil managed
{
    .maxstack 8
    L_0000: ldnull 
    L_0001: ret 
}

csc il:
.method public hidebysig instance !!P GetService<class P>() cil managed
{
    .maxstack 1
    .locals init (
        [0] !!P local)
    L_0000: ldloca.s local
    L_0002: initobj !!P
    L_0008: ldloc.0 
    L_0009: ret 
}

peverify says (out gmcs):
[IL]: Error: [test.dll : T::GetService[P]][offset 0x00000001][found Nullobjref 'NullReference'][expected (unboxed) 'P'] Unexpected type on the stack.
1 Error(s) Verifying test.dll
Comment 1 Marek Safar 2008-11-25 16:56:31 UTC

*** This bug has been marked as a duplicate of bug 324319 ***