From 6a980ae1c5ff4a4b82d13826cca5befde8036626 Mon Sep 17 00:00:00 2001 From: joncham Date: Mon, 19 Mar 2007 21:04:28 +0000 Subject: [PATCH] Revert 74623/74624 to fix build. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@74637 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mcs/ChangeLog | 4 ---- mcs/class.cs | 13 ++++--------- tests/test-45.cs | 30 +++++++++++++++--------------- tests/test-567.cs | 2 -- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/mcs/ChangeLog b/mcs/ChangeLog index 5b97157540..4ef0d905e3 100644 --- a/mcs/ChangeLog +++ b/mcs/ChangeLog @@ -1,7 +1,3 @@ -2007-03-19 Marek Safar - - * class.cs: Don't override existing implementation flags in all cases. - 2007-03-17 Marek Safar * class.cs (EventFieldAccessor.EmitMethod): Don't override existing diff --git a/mcs/class.cs b/mcs/class.cs index aec628d869..8f3425cde6 100644 --- a/mcs/class.cs +++ b/mcs/class.cs @@ -4020,10 +4020,8 @@ namespace Mono.CSharp { } if (a.IsInternalMethodImplAttribute) { - MethodBuilder.SetImplementationFlags (MethodBuilder.GetMethodImplementationFlags () | - MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); + MethodBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); is_external_implementation = true; - return; } if (a.Type == TypeManager.dllimport_type) { @@ -4835,8 +4833,7 @@ namespace Mono.CSharp { } if (a.IsInternalMethodImplAttribute) { - ConstructorBuilder.SetImplementationFlags (ConstructorBuilder.GetMethodImplementationFlags() | - MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); + ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); is_external_implementation = true; } @@ -6558,8 +6555,7 @@ namespace Mono.CSharp { public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb) { if (a.IsInternalMethodImplAttribute) { - MethodBuilder mb = method_data.MethodBuilder; - mb.SetImplementationFlags (mb.GetMethodImplementationFlags () | MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); + method_data.MethodBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); method.is_external_implementation = true; } @@ -7384,8 +7380,7 @@ namespace Mono.CSharp { public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb) { if (a.IsInternalMethodImplAttribute) { - MethodBuilder mb = method_data.MethodBuilder; - mb.SetImplementationFlags (mb.GetMethodImplementationFlags () | MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); + method_data.MethodBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime); method.is_external_implementation = true; } diff --git a/tests/test-45.cs b/tests/test-45.cs index 3214e5a574..0cd4bf49be 100644 --- a/tests/test-45.cs +++ b/tests/test-45.cs @@ -42,45 +42,45 @@ public class Blah { return 2; if (i [2] != 2) - return 3; + return 1; if (j [1,1] != 3) - return 4; + return 1; for (int t = 0; t < 4; ++t) { if (array [t] != t) - return 5; + return 1; if (a [t] != (t + 4)) - return 6; + return 1; } if (bar [2,1] != 20) - return 7; + return 1; if (k [2] != 5) - return 8; + return 1; if (m [1,1,1] != 9) - return 9; + return 1; if (boo [0,1] != 11) - return 10; + return 1; if (f_array [0] != 1.23F) - return 11; + return 1; if (double_arr [1] != 90.1226) - return 12; + return 1; foreach (string s in names) Console.WriteLine ("Hello, " + s); if (names [0] != "Miguel") - return 13; + return 1; if (c_arr [4] != 'R') - return 14; + return 2; int count = 10; @@ -92,17 +92,17 @@ public class Blah { for (int idx = count; idx > 0; ){ idx--; if (x [idx] != idx + 1) - return 15; + return 12; } IntPtr [] arr = { new System.IntPtr (1) }; if (arr [0] != (IntPtr) 1) - return 16; + return 13; IntPtr [] arr_i = { System.IntPtr.Zero }; if (arr_i [0] != System.IntPtr.Zero) - return 17; + return 14; Console.WriteLine ("Array initialization test okay."); diff --git a/tests/test-567.cs b/tests/test-567.cs index 4e5b1feeba..179420c009 100644 --- a/tests/test-567.cs +++ b/tests/test-567.cs @@ -1,7 +1,6 @@ using System; using System.Reflection; using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; namespace preservesig_test { @@ -34,7 +33,6 @@ namespace preservesig_test public event D e; [PreserveSig()] - [MethodImpl(MethodImplOptions.InternalCall,MethodCodeType=MethodCodeType.Runtime)] public int DoFoo() { return 0; -- 2.11.4.GIT