[Mono-bugs] [Bug 64231][Nor] New - [Embedding Mono] Accessing fields of structs

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 26 Aug 2004 20:05:48 -0400 (EDT)

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 priewasser@gmx.at.


--- shadow/64231	2004-08-26 20:05:48.000000000 -0400
+++ shadow/64231.tmp.29734	2004-08-26 20:05:48.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 64231
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: priewasser@gmx.at               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: [Embedding Mono] Accessing fields of structs
+Description of Problem:
+When accessing a field of a (C#-)struct from C, the methods 
+mono_field_set_value and mono_field_get_valus access the wrong momory 
+position. When calling the methods with an address (address of the 
+MonoObject) reduced by 8 (size of a MonoObject?) the methods work.
+I've attached a program that shows the the problem with 
+mono_field_set_value. In this program I tried to set "i" to 11 and write 
+out "i" afterwards.
+Steps to reproduce the problem:
+1. compile T.cs (mcs /t:library -out:T.dll T.cs)
+2. compile T.c (gcc -o T T.c `pkg-config --cflags --libs mono`)
+3. run T (./T)
+Actual Results:
+any number
+Expected Results:
+How often does this happen? 
+Additional Information:
+There is no problem accessing a field of a class or a static field of a