Bug 318176 (MONO75156) - [GMCS] miscompiles 'is' statement
Summary: [GMCS] miscompiles 'is' statement
Status: RESOLVED FIXED
Alias: MONO75156
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-04 20:21 UTC by Forgotten User vxPDddArjq
Modified: 2007-09-15 21:24 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 Thomas Wiest 2007-09-15 19:20:10 UTC


---- Reported by vargaz@gmail.com 2005-06-04 13:21:20 MST ----

Testcase:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
using System;
using System.Reflection;

public class Tests {

	public void GetName (MethodBase method, out object retType) {
		retType = method is ConstructorInfo ? new Object () : new Object ();
	}

	public static void Main () {
		object o;
		new Tests ().GetName (typeof (Tests).GetMethod ("Main"), out o);
	}
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

When compiling this with gmcs, it prints:

uj.cs(7) warning CS0184: The given expression is never of the provided
('System.Nullable`1') type

also, the generated IL looks doesn't contain an isinst instruction at all:

       .maxstack 8
        IL_0000:  ldarg.2
        IL_0001:  br IL_0010

        IL_0006:  newobj instance void object::.ctor()
        IL_000b:  br IL_0015

        IL_0010:  newobj instance void object::.ctor()
        IL_0015:  stind.ref
        IL_0016:  ret



---- Additional Comments From martin@ximian.com 2005-06-08 12:01:14 MST ----

Fixed in SVN.



---- Additional Comments From miguel@ximian.com 2005-06-08 14:37:40 MST ----

close bug

This bug blocked bug(s) 75153.

Unknown operating system unknown. Setting to default OS "Other".