[Mono-bugs] [Bug 73058][Nor] New - int -> pointer conversion should use conv.i instead of conv.u
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 26 Feb 2005 08:19:58 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by vargaz@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=73058
--- shadow/73058 2005-02-26 08:19:58.000000000 -0500
+++ shadow/73058.tmp.15264 2005-02-26 08:19:58.000000000 -0500
@@ -0,0 +1,38 @@
+Bug#: 73058
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: vargaz@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: int -> pointer conversion should use conv.i instead of conv.u
+
+In the following test case:
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+using System;
+
+public unsafe class Tests {
+
+ private void *value;
+
+ public static void Main () {
+ Tests t = new Tests ();
+
+ int i = -1;
+ t.value = (void*)i;
+ Console.WriteLine ((long)t.value);
+ }
+}
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+csc emits conv.i to convert 'i' to a void*, while mcs emits conv.u. This
+means the program prints out a different value on 32 bit and 64 bit machines.