[Mono-bugs] [Bug 72494][Min] New - Bug in static field initialization

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 11 Feb 2005 10:55:24 -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 jb.evain@dotnetguru.org.

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

--- shadow/72494	2005-02-11 10:55:24.000000000 -0500
+++ shadow/72494.tmp.1324	2005-02-11 10:55:24.000000000 -0500
@@ -0,0 +1,80 @@
+Bug#: 72494
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jb.evain@dotnetguru.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Bug in static field initialization
+
+Description of Problem:
+
+Hello,
+
+According to the spec, static fields should'nt be initialized by data in
+the constant table. That's what Mono does.
+
+Steps to reproduce the problem:
+1. Compile this cil file into a pe executable:
+
+.assembly extern mscorlib {} 
+
+
+
+.assembly test {} 
+
+
+
+.module test.exe 
+
+
+
+.class public EntryPoint extends [mscorlib]System.Object { 
+
+
+
+  .field public static int32 m_test = int32(2) 
+
+
+
+  .method public static void Main() cil managed {
+
+      .entrypoint
+
+      ldsfld int32 EntryPoint::m_test
+
+      box [mscorlib]System.Int32
+
+      call void [mscorlib]System.Console::WriteLine(object)
+
+      ret
+
+  }
+
+} 
+
+2. Run it 
+
+Actual Results:
+2 is printed
+
+Expected Results:
+0 should be printed
+
+How often does this happen? 
+Always.
+
+Additional Information:
+This is a by design behaviour described in the spec.
+
+When this will be fixed, could the path be attached here ? I've tried one
+things or two, and I'd like to see how it should be corrected.