[Mono-bugs] [Bug 36083][Nor] New - multiple clauses in fixed block generates incorrect code.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
24 Dec 2002 16:24:36 -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=36083
--- shadow/36083 Tue Dec 24 11:24:36 2002
+++ shadow/36083.tmp.674 Tue Dec 24 11:24:36 2002
@@ -0,0 +1,75 @@
+Bug#: 36083
+Product: Mono/MCS
+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: multiple clauses in fixed block generates incorrect code.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+using multiple expressions in a "fixed" clause duplicates code.
+
+Steps to reproduce the problem:
+ public class SimpleTest
+ {
+ int myMember;
+ int myMember2;
+
+ public unsafe void Test()
+ {
+ fixed (void* ptr = &this.myMember, pThis = &this.myMember2)
+ {
+ if (ptr == null)
+ System.Console.WriteLine("ptr == null");
+ else
+ System.Console.WriteLine("ptr != null");
+
+ if (pThis == null)
+ System.Console.WriteLine("pThis == null");
+ else
+ System.Console.WriteLine("pThis != null");
+ }
+ }
+
+ public static int Main(string [] args)
+ {
+ SimpleTest test = new SimpleTest();
+ test.Test();
+
+ return 0;
+ }
+ }
+
+
+
+Actual Results:
+ptr != null
+pThis == null
+ptr == null
+pThis != null
+
+Expected Results:
+ptr != null
+pThis != null
+
+How often does this happen?
+Always.
+
+Additional Information:
+This prevents Mono.PEToolkit from working (PEUtils.cs line 278 does this).
+
+Making two nested fixed blocks, one nested inside the other, generates
+correct code.