Fix #76133.
* mcs/expression.cs (This.VerifyFixed): In a value type T, the type of
'this' is T&, iow, 'this' is either an out or ref parameter. In a
value type R, 'this' is treated as a value parameter.
* tests/test-456.cs: New test from #76133.
* errors/cs0212-3.cs: New test based on #76133.
svn path=/trunk/mcs/; revision=50753
+2005-09-26 Raja R Harinath <rharinath@novell.com>
+
+ * cs0212-3.cs: New test based on #76133.
+
2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
* gcs0208-2.cs, gcs0208-3.cs, gcs0208-4.cs : added test with related
--- /dev/null
+// cs0212-3.cs: You can only take the address of unfixed expression inside of a fixed statement initializer
+// Line: 10
+// Compiler options: -unsafe
+
+struct Foo {
+ public float f;
+ public void foo ()
+ {
+ unsafe {
+ float *pf1 = &f;
+ }
+ }
+}
+
+class Test {
+ static void Main ()
+ {
+ Foo x = new Foo ();
+ x.foo ();
+ }
+}
cs0121-3.cs NO ERROR
cs0201.cs
cs0202.cs # new in GMCS
+cs0212-3.cs NO ERROR
cs0229-2.cs
cs0229.cs NO ERROR
cs0266-2.cs NO ERROR
cs0619-45.cs NO ERROR
cs0619-46.cs NO ERROR
cs0619-31.cs NO ERROR
-cs1674-2.cs
\ No newline at end of file
+cs1674-2.cs
+2005-09-26 Raja R Harinath <rharinath@novell.com>
+
+ Fix #76133.
+ * expression.cs (This.VerifyFixed): In a value type T, the type of
+ 'this' is T&, iow, 'this' is either an out or ref parameter. In a
+ value type R, 'this' is treated as a value parameter.
+
2005-09-22 Miguel de Icaza <miguel@novell.com>
* statement.cs (Lock): Use the TemporaryVariable class instead of
public bool VerifyFixed ()
{
- // Treat 'this' as a value parameter for the purpose of fixed variable determination.
- return true;
+ return !TypeManager.IsValueType (Type);
}
public bool ResolveBase (EmitContext ec)
+2005-09-26 Raja R Harinath <rharinath@novell.com>
+
+ * test-456.cs: New test from #76133.
+
2005-09-15 Raja R Harinath <rharinath@novell.com>
* test-455.cs: New test. Distilled from a failing unit test of
test-442.cs IGNORE # Compiles to invalid IL
test-453.cs IGNORE
test-454.cs IGNORE
+test-456.cs
test-50.cs IGNORE # Windows-only test
test-67.cs IGNORE # Windows-only test
--- /dev/null
+// Compiler options: -unsafe
+
+struct Foo {
+ public float f;
+ public void foo ()
+ {
+ unsafe {
+ fixed (float *pf2 = &f) {
+ }
+ }
+ }
+}
+
+class Test {
+ static void Main ()
+ {
+ Foo x = new Foo ();
+ x.foo ();
+ }
+}