[Mono-bugs] [Bug 36082][Nor] New - copying value types does not work in some cases

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
24 Dec 2002 16:05:12 -0000


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 d@young.hostforweb.com.

http://bugzilla.ximian.com/show_bug.cgi?id=36082

--- shadow/36082	Tue Dec 24 11:05:12 2002
+++ shadow/36082.tmp.11666	Tue Dec 24 11:05:12 2002
@@ -0,0 +1,79 @@
+Bug#: 36082
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: gentoo linux.
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: d@young.hostforweb.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: copying value types does not work in some cases
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Copying a value type into a class field doesn't work when I copy the field
+directly.  Making the field a get/set property fixes this.  Sometimes using
+a temporary also fixes it.
+
+Steps to reproduce the problem:
+
+using System.Reflection.Emit;
+
+namespace MyTest
+{
+	public class SimpleTest
+	{
+		class TestClass
+		{
+			public OpCode op;
+		}
+
+		public static int Main(string [] args)
+		{
+			// this works (prints InlineBrTarget)
+			System.Console.WriteLine(OpCodes.Br.OperandType);
+
+			// this doesn't work (print 136509916)
+			TestClass test1 = new TestClass();
+			test1.op = OpCodes.Br;
+			System.Console.WriteLine(test1.op.OperandType);
+
+			// this works (prints InlineBrTarget)
+			OpCode valOp = OpCodes.Br;
+			TestClass test2 = new TestClass();
+			test2.op = valOp;
+			System.Console.WriteLine(test2.op.OperandType);
+
+			return 0;
+		}
+	}
+}
+
+
+Actual Results:
+InlineBrTarget
+136509916
+InlineBrTarget
+
+Expected Results:
+InlineBrTarget
+InlineBrTarget
+InlineBrTarget
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+I'm not sure if this is an mcs bug or a runtime bug.  I looked at the
+disassembly and didn't see any obvious problem so I'm entering as a runtime
+bug.