Revert "Fix object::GetType when remoting is enabled."
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 1 Mar 2013 15:54:09 +0000 (10:54 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 1 Mar 2013 15:54:09 +0000 (10:54 -0500)
This reverts commit 93e2d1dc48339be472300910e9290939ee253177.

45 files changed:
mcs/class/Mono.Security/Test/Mono.Math/ArithmeticBigTest.cs
mcs/class/Mono.Security/Test/Mono.Math/SearchGeneratorTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Authenticode/AuthenticodeDeformatterTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Authenticode/PrivateKeyTest.cs
mcs/class/Mono.Security/Test/Mono.Security.Authenticode/SoftwarePublisherCertificateTest.cs
mcs/class/Mono.Security/Test/Mono.Security/StrongNameTest.cs
mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs
mcs/class/System.Net.Http/Test/System.Net.Http/StringContentTest.cs
mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonSerializer.cs
mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionCollectionTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization.Advanced/SchemaImporterExtensionTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/SoapSchemaExporterTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaExporterTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemaImporterTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs
mcs/class/System.XML/Test/System.Xml/XmlDocumentEventTests.cs
mcs/class/System.XML/Test/System.Xml/XmlSecureResolverCas.cs
mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
mcs/class/System.XML/Test/System.Xml/XmlWriterSettingsTests.cs
mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XAttributeTest.cs
mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs
mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs
mcs/class/corlib/System.Collections.ObjectModel/ReadOnlyDictionary.cs [new file with mode: 0644]
mcs/class/corlib/System.IO/Path.cs
mcs/class/corlib/System.Text/Decoder.cs
mcs/class/corlib/System.Text/UTF8Encoding.cs
mcs/class/corlib/Test/System.IO/PathTest.cs
mcs/class/corlib/Test/System.Text/DecoderTest.cs
mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
mcs/class/corlib/corlib.dll.sources
mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/HoistedLocals.cs
mono/metadata/class-internals.h
mono/metadata/icall.c
mono/metadata/marshal.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/image-writer.c
mono/mini/mini-arm.c
mono/mini/mini.c
mono/mini/patch-info.h
msvc/mono.sln

index 94ff296ced511a8752575675a1f99ad0b4eed515..ac05640807f2a6103de0a821deaaeead985de730 100644 (file)
@@ -179,48 +179,48 @@ namespace MonoTests.Mono.Math.Arithmetic.Big {
                [Test]
                public void AgtB () 
                {
-                       Assertion.Assert(A > B);
+                       Assert.IsTrue(A > B);
                }
                
                [Test]
                public void ANotLtB () 
                {
-                       Assertion.Assert(!(A < B));
+                       Assert.IsTrue(!(A < B));
                }
                
                [Test]
                public void BNotGtA () 
                {
-                       Assertion.Assert(!(B > A));
+                       Assert.IsTrue(!(B > A));
                }
                
                [Test]
                public void AltB () 
                {
-                       Assertion.Assert(B < A);
+                       Assert.IsTrue(B < A);
                }
                
                [Test]
                public void AeqA () 
                {
-                       Assertion.Assert(A == A);
+                       Assert.AreEqual(A, A);
                }
                [Test]
                public void BeqB () 
                {
-                       Assertion.Assert(B == B);
+                       Assert.AreEqual(B, B);
                }
                
                [Test]
                public void AneqB () 
                {
-                       Assertion.Assert(A != B);
+                       Assert.AreNotEqual(A, B);
                }
                
                [Test]
                public void BneqA () 
                {
-                       Assertion.Assert(B != A);
+                       Assert.AreNotEqual(B, A);
                }
 
                #endregion
index 189dbd9d0dff051a6116f6309f3139e259975a63..80434f9983ca1dd3296fe96cfdfbdf61372dc34f 100644 (file)
@@ -62,7 +62,7 @@ namespace MonoTests.Mono.Math {
                        for (int i = 0; i < 5; i++) {
                                ContextData ctx = new ContextData (128, (uint)r.Next (int.MinValue, int.MaxValue));
                                BigInteger p = GenerateNewPrime (128, ctx);
-                               Assertion.Assert (p.TestBit (1));
+                               Assert.IsTrue (p.TestBit (1));
                                uint d = ctx.testData;
                                for (uint j = 128 - 2; d > 0; j--, d >>= 1)
                                        Assertion.AssertEquals ((d&1) == 1, p.TestBit (j));
index d15087aef00469515cde84a97af6d6353d6189cb..0a1fd9f3d1a6237b8fca130e7c56838c301fdd34 100644 (file)
@@ -678,7 +678,7 @@ namespace MonoTests.Mono.Security.Authenticode {
 
                private string WriteFile () 
                {
-                       string filename = "helloworld_signed.exe";
+                       string filename = Path.Combine (Path.GetTempPath (), "helloworld_signed.exe");
                        try {
                                if (File.Exists (filename)) {
                                        File.Delete (filename);
index ee8145cff6b7cc28d86819aec04382807e114bfc..0f529496e1183d56568e8535ed5a0f53a4aa9629 100644 (file)
@@ -96,7 +96,13 @@ public class PrivateKeyTest : Assertion {
                Assert (msg, a);
        }
 
-       private const string testfile = "test.pvk";
+       string testfile;
+               
+       [TestFixtureSetUp]
+       public void FixtureSetup ()
+       {
+               testfile = Path.Combine (Path.GetTempPath (), "test.pvk");
+       }
 
        [TearDown]
        public void TearDown () 
index 6e6adce2b8690beefce487b448dce2092564b07e..11136a489046ed966fc960e910d260ae77a1327f 100644 (file)
@@ -381,7 +381,13 @@ namespace MonoTests.Mono.Security.Authenticode {
                0x77, 0xEF, 0xEC, 0x17, 0x92, 0xC7, 0xD6, 0xCD, 0xE1, 0x2A, 0x2E, 0xE7, 
                0xF3, 0xED, 0x7F, 0x66, 0x86, 0x31, 0x00 };
        
-               private const string testfile = "test.spc";
+               string testfile;
+
+               [TestFixtureSetUp]
+               public void FixtureSetup ()
+               {
+                       testfile = Path.Combine (Path.GetTempPath (), "test.spc");
+               }
        
                [TearDown]
                public void TearDown () 
@@ -397,11 +403,11 @@ namespace MonoTests.Mono.Security.Authenticode {
                                if (unicode) {
                                        data = Encoding.Unicode.GetBytes (s);
                                } else if (pem) {
-                                       string b64pem = "-----BEGIN PKCS7-----\n" + s + "\n-----END PKCS7-----";
-                                       data = Encoding.ASCII.GetBytes (b64pem);
-                       using (FileStream fs = File.Create ("bad.pem")) {
-                               fs.Write (data, 0, data.Length);
-                       }
+                                       //string b64pem = "-----BEGIN PKCS7-----\n" + s + "\n-----END PKCS7-----";
+                                       //data = Encoding.ASCII.GetBytes (b64pem);
+                                       //using (FileStream fs = File.Create ("bad.pem")) {
+                                       //      fs.Write (data, 0, data.Length);
+                                       //}
                                } else {
                                        data = Encoding.ASCII.GetBytes (s);
                                }
index 43bc7a5fbb9b0bdbfb8fb3cb522d93d07fd1ea80..05e013cd4aa2a26d7080df77256a51e636311396 100644 (file)
@@ -127,8 +127,8 @@ namespace MonoTests.Mono.Security {
                        AssertEquals ("key.PublicKeyToken", sn1.PublicKeyToken, sn2.PublicKeyToken);
                }
 
-               private const string Signed = "hellosigned.exe";
-               private const string Delay = "hellodelay.exe";
+               string Signed;
+               string Delay;
                private StrongName sn;
                private static byte[] signedData = {
                        0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 
@@ -787,11 +787,16 @@ namespace MonoTests.Mono.Security {
                [SetUp]
                public void SetUp () 
                {
+                       Signed = Path.Combine (Path.GetTempPath (), "hellosigned.exe");
+                       Delay = Path.Combine (Path.GetTempPath (), "hellodelay.exe");
+
                        sn = new StrongName (key);
                        // write hellosigned.exe to disk
                        FileStream fs = File.OpenWrite (Signed);
                        fs.Write (signedData, 0, signedData.Length);
                        fs.Close ();
+
+
                        // write hellodelay.exe to disk
                        fs = File.OpenWrite (Delay);
                        fs.Write (delayData, 0, delayData.Length);
index c5a8dc430ad05bf505fd3182bae3a5cb8916db75..6651be4a64fac113d36b852cf72cbec8efe32fa4 100644 (file)
@@ -525,7 +525,7 @@ namespace MonoTests.System.Net.Http
                                        client.SendAsync (request, HttpCompletionOption.ResponseContentRead).Wait (WaitTimeout);
                                        Assert.Fail ("#2");
                                } catch (AggregateException e) {
-                                       Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#3");
+                                       Assert.IsTrue (e.InnerException is HttpRequestException, "#3");
                                }
 
                        } finally {
@@ -699,7 +699,7 @@ namespace MonoTests.System.Net.Http
                                        client.GetByteArrayAsync (LocalServer).Wait (WaitTimeout);
                                        Assert.Fail ("#1");
                                } catch (AggregateException e) {
-                                       Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2");
+                                       Assert.IsTrue (e.InnerException is HttpRequestException , "#2");
                                }
                        } finally {
                                listener.Close ();
@@ -726,7 +726,7 @@ namespace MonoTests.System.Net.Http
                                        client.GetStringAsync (LocalServer).Wait (WaitTimeout);
                                        Assert.Fail ("#1");
                                } catch (AggregateException e) {
-                                       Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2");
+                                       Assert.IsTrue (e.InnerException is HttpRequestException, "#2");
                                }
                        } finally {
                                listener.Abort ();
index b4a541afab286291a3e2d2a026354002f25a4315..edd4b839c164c1e7d638067ac367a3dfa2dc3ecf 100644 (file)
@@ -331,7 +331,7 @@ namespace MonoTests.System.Net.Http
                                Assert.IsTrue (sc.LoadIntoBufferAsync (50).Wait (200));
                                Assert.Fail ("#1");
                        } catch (AggregateException e) {
-                               Assert.IsInstanceOfType (typeof (HttpRequestException), e.InnerException, "#2");
+                               Assert.IsTrue (e.InnerException is HttpRequestException, "#2");
                        }
                }
 
index 51a077176b8d470b80b24ef6397f4b3c02e91b56..f031fc3ea8eb9ef10a863e023744cb0efdc76cc2 100644 (file)
@@ -61,9 +61,10 @@ namespace MonoTests.System.Net.Http
 
                        var s = new StringContent ("aaa", null, "multipart/*");
                        Assert.AreEqual ("Content-Type: multipart/*; charset=utf-8\r\n", s.Headers.ToString ());
-
+#if !MOBILE
                        s = new StringContent ("aaa", Encoding.GetEncoding (852), "multipart/*");
                        Assert.AreEqual ("Content-Type: multipart/*; charset=ibm852\r\n", s.Headers.ToString ());
+#endif
                }
 
                [Test]
index 42d59afb18e40d07de3a51cd8fc0bf96aeb20bc6..595727220ee46d141770b7e40e224d1f5b4a6374 100644 (file)
@@ -431,12 +431,12 @@ namespace System.Web.Script.Serialization
 
                void WriteValue (StringBuilder output, float value)
                {
-                       StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
+                       StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r", CultureInfo.InvariantCulture));
                }
 
                void WriteValue (StringBuilder output, double value)
                {
-                       StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
+                       StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r", CultureInfo.InvariantCulture));
                }
                
                void WriteValue (StringBuilder output, Guid value)
index 0e91387a4be8b56b45dc91d13fcf5feced7fd086..779c8bd1e1ea3de3d279be722c5b3c4ba63d7c23 100644 (file)
@@ -173,6 +173,7 @@ namespace MonoTests.System.Xml
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void TestSimpleMutualImport ()
                {
                        XmlReader r = new XmlTextReader ("Test/XmlFiles/xsd/inter-inc-1.xsd");
index 718e62c1fff361c4039a7a084ef1308ca9f5b2a2..20b0d5dbaf8697afee0e02498b3dfaaca31f71d7 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+#if !MOBILE
 
 using System;
 using System.CodeDom;
index 5b8d9de6dcc3c6dbeb7bd8540262cdb8493e5848..7311fbb27e8ea4566730306f8ed9fb9acc66c1d8 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+#if !MOBILE
 
 using System;
 using System.CodeDom;
index 9f0e019113573d4e3992a88d1a31fcf36fdc16d8..b1c7597c150962efc3b53344b5d894c2ba615993 100644 (file)
@@ -7,6 +7,8 @@
 // (C) 2005 Novell
 // 
 
+#if !MOBILE
+
 using System;
 using System.Collections;
 using System.Globalization;
@@ -1159,3 +1161,5 @@ namespace MonoTests.System.XmlSerialization
                }
        }
 }
+
+#endif
\ No newline at end of file
index 25a1ecf74bfdaacb1c357445bc5529916a7ca99a..91f0ed1d2826029b5022570b568de0c65eeb3f76 100644 (file)
@@ -8,6 +8,8 @@
 // (C) 2006 Novell
 // 
 
+#if !MOBILE
+
 using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
@@ -1304,3 +1306,5 @@ namespace MonoTests.System.XmlSerialization
                }
        }
 }
+
+#endif
index f8713258a0f20f9095fb06c1801a612c27f10b3f..fc55852869da82e5aaa0c3273a4f12edf38665a2 100644 (file)
@@ -1783,11 +1783,9 @@ namespace MonoTests.System.XmlSerialization
                [Test]
 #if NET_2_0
                [Category ("NotWorking")] // support for XmlSchemaProvider is not implemented
-#else
-               [Category ("NotWorking")] // mark it NotWorking until fixes have landed in svn
 #endif
                public void ExportXmlSerializable_SchemaProvider1 () {
-                       XmlSchemas schemas = schemas = Export (typeof (PrimitiveSchemaProvider));
+                       XmlSchemas schemas = Export (typeof (PrimitiveSchemaProvider));
                        Assert.AreEqual (1, schemas.Count, "#1");
 
                        StringWriter sw = new StringWriter ();
index 809586676392ccad696605b341eda574aebe5655..fe4838cb2e9d8184999494e9a45d2809f8550f8f 100644 (file)
@@ -39,8 +39,9 @@ using System.IO;
 using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
+#if !MOBILE
 using Microsoft.CSharp;
-
+#endif
 using NUnit.Framework;
 
 using MonoTests.System.Xml.TestClasses;
@@ -891,6 +892,8 @@ namespace MonoTests.System.Xml.Serialization
                        Assert.AreEqual ("UInt16", map.TypeName, "#6");
                }
 
+#if !MOBILE
+
                [Test]
                public void ImportTypeMapping_EnumSimpleContent ()
                {
@@ -1075,30 +1078,6 @@ namespace MonoTests.System.Xml.Serialization
                        return null;
                }
 
-               private static XmlSchemas ExportType (Type type)
-               {
-                       XmlReflectionImporter ri = new XmlReflectionImporter ("NS" + type.Name);
-                       XmlSchemas schemas = new XmlSchemas ();
-                       XmlSchemaExporter sx = new XmlSchemaExporter (schemas);
-                       XmlTypeMapping tm = ri.ImportTypeMapping (type);
-                       sx.ExportTypeMapping (tm);
-                       return schemas;
-               }
-
-               private static ArrayList GetXmlQualifiedNames (XmlSchemas schemas)
-               {
-                       ArrayList qnames = new ArrayList ();
-
-                       foreach (XmlSchema schema in schemas) {
-                               if (!schema.IsCompiled) schema.Compile (null);
-                               foreach (XmlSchemaObject ob in schema.Items)
-                                       if (ob is XmlSchemaElement)
-                                               qnames.Add (((XmlSchemaElement) ob).QualifiedName);
-                       }
-
-                       return qnames;
-               }
-
                [Test]
                [ExpectedException (typeof (InvalidOperationException))]
                public void ImportTypeMappingNonExistent ()
@@ -1238,5 +1217,31 @@ namespace MonoTests.System.Xml.Serialization
                                xss.Add (XmlSchema.Read (new XmlTextReader (new StringReader (xsd)), null));
                        return new XmlSchemaImporter (xss);
                }
+
+#endif
+
+               private static ArrayList GetXmlQualifiedNames (XmlSchemas schemas)
+               {
+                       ArrayList qnames = new ArrayList ();
+                       
+                       foreach (XmlSchema schema in schemas) {
+                               if (!schema.IsCompiled) schema.Compile (null);
+                               foreach (XmlSchemaObject ob in schema.Items)
+                                       if (ob is XmlSchemaElement)
+                                               qnames.Add (((XmlSchemaElement) ob).QualifiedName);
+                       }
+                       
+                       return qnames;
+               }
+
+               private static XmlSchemas ExportType (Type type)
+               {
+                       XmlReflectionImporter ri = new XmlReflectionImporter ("NS" + type.Name);
+                       XmlSchemas schemas = new XmlSchemas ();
+                       XmlSchemaExporter sx = new XmlSchemaExporter (schemas);
+                       XmlTypeMapping tm = ri.ImportTypeMapping (type);
+                       sx.ExportTypeMapping (tm);
+                       return schemas;
+               }
        }
 }
index a7f00ab1e24e084243c71cb2ad5424f4c35c12cf..ed63ede99faa074613c70514f6c53e6309fb5680 100644 (file)
@@ -2187,8 +2187,7 @@ namespace MonoTests.System.XmlSerialization
                        ser.Deserialize (new XmlTextReader (xml, XmlNodeType.Document, null));
                }
 
-#if NET_2_0
-#if !TARGET_JVM
+#if !TARGET_JVM && !MOBILE
                [Test]
                public void GenerateSerializerGenerics ()
                {
@@ -2266,7 +2265,6 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (TestEnumWithNulls.bb, w.nenum.Value);
                        Assert.AreEqual (t, w.ndate.Value);
                }
-#endif
 
                [Test]
                public void SerializeBase64Binary()
index 4df96725fbbd89e28d518da58925e600cb628ef0..657d672e5bcc69e7cd7e1f14263c40479ddfd0c8 100644 (file)
@@ -18,11 +18,6 @@ namespace MonoTests.System.Xml
        [TestFixture]\r
        public class XmlDocumentEventTests\r
        {\r
-               public static void Main ()\r
-               {\r
-                       new XmlDocumentEventTests ().InsertingOrder ();\r
-               }\r
-\r
                private StringBuilder eventLogBuilder = new StringBuilder ();\r
 \r
                private XmlDocument GetEventDocument ()\r
index d8035e4d010af8d219ff81459e409a0652f83ee2..52de90d1414348ee23777ff29d52173e789c3237 100644 (file)
@@ -27,6 +27,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOBILE
+
 using NUnit.Framework;
 
 using System;
@@ -82,3 +84,5 @@ namespace MonoCasTests.System.Xml {
                }
        }
 }
+
+#endif
\ No newline at end of file
index 0603a694d4273d5a371a769fe8eb70085f42b9e2..c97407de984b032cb072d58e56720f1abf150171 100644 (file)
@@ -8,6 +8,8 @@
 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 
+#if !MOBILE
+
 using System;
 using System.Collections;
 using System.IO;
@@ -132,3 +134,4 @@ namespace MonoTestsXml
        }
 }
 
+#endif
index 17e94fc1567758c152a34016227c4fac5c31660a..59752547bc0d07fccaaa14c8a112e28ede063a73 100644 (file)
@@ -104,19 +104,17 @@ namespace MonoTests.System.Xml
 \r
 #if NET_4_5\r
                [Test]\r
-               [Category("Async")]\r
                public void TestAsync ()\r
                {\r
                        var loc = Assembly.GetExecutingAssembly ().Location;\r
                        Uri resolved = resolver.ResolveUri (null, loc);\r
                        Assert.AreEqual ("file", resolved.Scheme);\r
                        var task = resolver.GetEntityAsync (resolved, null, typeof (Stream));\r
-                       Assert.That (task.Wait (3000));\r
-                       Assert.IsInstanceOfType (typeof (Stream), task.Result);\r
+                       Assert.IsTrue (task.Wait (3000));\r
+                       Assert.IsTrue (task.Result is Stream);\r
                }\r
 \r
                [Test]\r
-               [Category("Async")]\r
                public void TestAsyncError ()\r
                {\r
                        var loc = Assembly.GetExecutingAssembly ().Location;\r
@@ -129,7 +127,7 @@ namespace MonoTests.System.Xml
                        } catch (Exception ex) {\r
                                if (ex is AggregateException)\r
                                        ex = ((AggregateException) ex).InnerException;\r
-                               Assert.IsInstanceOfType (typeof (XmlException), ex);\r
+                               Assert.IsTrue (ex is XmlException);\r
                        }\r
                }\r
 #endif\r
index 6ade78b4461aa4b8413061c140875c8dacce60ff..bd5cb6af26f978537a65a49360b5316f43cb4258 100644 (file)
@@ -47,6 +47,7 @@ namespace MonoTests.System.Xml
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void EncodingTest ()
                {
                        // For Stream it makes sense
index 15bad621e9c584a1ab0d8fb4181d47db339fa8c7..7d1e8302b68fd41e5734213560bf68b3d0b0c9a0 100644 (file)
@@ -451,7 +451,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.IsNotNull ((double?) new XAttribute (m), "m:double?:null");
                        Assert.AreEqual (double.NegativeInfinity, ((double?) new XAttribute (m)).Value, "m:double?:value");
                        Assert.IsNotNull ((double?) new XAttribute (n), "n:double?:null");
-                       Assert.IsNaN (((double?) new XAttribute (n)).Value, "n:double?:value");
+                       Assert.AreEqual (double.NaN, ((double?) new XAttribute (n)).Value, "n:double?:value");
                        Assert.IsNotNull ((float?) new XAttribute (a), "a:float?:null");
                        Assert.AreEqual (7f, ((float?) new XAttribute (a)).Value, "a:float?:value");
                        Assert.IsNotNull ((float?) new XAttribute (b), "b:float?:null");
@@ -473,7 +473,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.IsNotNull ((float?) new XAttribute (m), "m:float?:null");
                        Assert.AreEqual (float.NegativeInfinity, ((float?) new XAttribute (m)).Value, "m:float?:value");
                        Assert.IsNotNull ((float?) new XAttribute (n), "n:float?:null");
-                       Assert.IsNaN (((float?) new XAttribute (n)).Value, "n:float?:value");
+                       Assert.AreEqual (float.NaN, ((float?) new XAttribute (n)).Value, "n:float?:value");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XAttribute (a); }, "a:Guid?");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XAttribute (b); }, "b:Guid?");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XAttribute (c); }, "c:Guid?");
@@ -629,7 +629,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.AreEqual (double.PositiveInfinity, (double) new XAttribute (i), "i:double");
                        Assert.AreEqual (double.NegativeInfinity, (double) new XAttribute (M), "M:double");
                        Assert.AreEqual (double.NegativeInfinity, (double) new XAttribute (m), "m:double");
-                       Assert.IsNaN (((double) new XAttribute (n)), "n:double");
+                       Assert.AreEqual (double.NaN, ((double) new XAttribute (n)), "n:double");
                        Assert.AreEqual (7f, (float) new XAttribute (a), "a:float");
                        Assert.AreEqual (42f, (float) new XAttribute (b), "b:float");
                        Assert.AreEqual (123f, (float) new XAttribute (c), "c:float");
@@ -640,7 +640,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.AreEqual (float.PositiveInfinity, (float) new XAttribute (i), "i:float");
                        Assert.AreEqual (float.NegativeInfinity, (float) new XAttribute (M), "M:float");
                        Assert.AreEqual (float.NegativeInfinity, (float) new XAttribute (m), "m:float");
-                       Assert.IsNaN (((float) new XAttribute (n)), "n:float");
+                       Assert.AreEqual (float.NaN, ((float) new XAttribute (n)), "n:float");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XAttribute (a); }, "a:Guid");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XAttribute (b); }, "b:Guid");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XAttribute (c); }, "c:Guid");
index 59a3854316448cd5382f8638274399b305a9987e..5a5f255094c74c579df300882bd87538267d25e7 100644 (file)
@@ -907,7 +907,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.IsNotNull ((double?) new XElement (m), "m:double?:null");
                        Assert.AreEqual (double.NegativeInfinity, ((double?) new XElement (m)).Value, "m:double?:value");
                        Assert.IsNotNull ((double?) new XElement (n), "n:double?:null");
-                       Assert.IsNaN (((double?) new XElement (n)).Value, "n:double?:value");
+                       Assert.AreEqual (double.NaN, ((double?) new XElement (n)).Value, "n:double?:value");
                        Assert.IsNotNull ((float?) new XElement (a), "a:float?:null");
                        Assert.AreEqual (7f, ((float?) new XElement (a)).Value, "a:float?:value");
                        Assert.IsNotNull ((float?) new XElement (b), "b:float?:null");
@@ -929,7 +929,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.IsNotNull ((float?) new XElement (m), "m:float?:null");
                        Assert.AreEqual (float.NegativeInfinity, ((float?) new XElement (m)).Value, "m:float?:value");
                        Assert.IsNotNull ((float?) new XElement (n), "n:float?:null");
-                       Assert.IsNaN (((float?) new XElement (n)).Value, "n:float?:value");
+                       Assert.AreEqual (float.NaN, ((float?) new XElement (n)).Value, "n:float?:value");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XElement (a); }, "a:Guid?");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XElement (b); }, "b:Guid?");
                        AssertThrows<FormatException> (() => { Guid? z = (Guid?) new XElement (c); }, "c:Guid?");
@@ -1085,7 +1085,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.AreEqual (double.PositiveInfinity, (double) new XElement (i), "i:double");
                        Assert.AreEqual (double.NegativeInfinity, (double) new XElement (M), "M:double");
                        Assert.AreEqual (double.NegativeInfinity, (double) new XElement (m), "m:double");
-                       Assert.IsNaN (((double) new XElement (n)), "n:double");
+                       Assert.AreEqual (double.NaN, ((double) new XElement (n)), "n:double");
                        Assert.AreEqual (7f, (float) new XElement (a), "a:float");
                        Assert.AreEqual (42f, (float) new XElement (b), "b:float");
                        Assert.AreEqual (13f, (float) new XElement (c), "c:float");
@@ -1096,7 +1096,7 @@ namespace MonoTests.System.Xml.Linq
                        Assert.AreEqual (float.PositiveInfinity, (float) new XElement (i), "i:float");
                        Assert.AreEqual (float.NegativeInfinity, (float) new XElement (M), "M:float");
                        Assert.AreEqual (float.NegativeInfinity, (float) new XElement (m), "m:float");
-                       Assert.IsNaN (((float) new XElement (n)), "n:float");
+                       Assert.AreEqual (float.NaN, ((float) new XElement (n)), "n:float");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XElement (a); }, "a:Guid");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XElement (b); }, "b:Guid");
                        AssertThrows<FormatException> (() => { Guid z = (Guid) new XElement (c); }, "c:Guid");
index 2ed1b5dedb6a0133abb73186735273d57dba289f..da577e644effc0f851c9617fa46466d4140a3c4a 100644 (file)
@@ -9,6 +9,8 @@
 // (C) Stefan Prutianu
 // 
 
+#if !MOBILE
+
 using NUnit.Framework;
 using System;
 using System.Xml;
@@ -467,3 +469,5 @@ namespace MonoTests.System.Xml.Schema
 
        }
 }
+
+#endif
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Collections.ObjectModel/ReadOnlyDictionary.cs b/mcs/class/corlib/System.Collections.ObjectModel/ReadOnlyDictionary.cs
new file mode 100644 (file)
index 0000000..a012b56
--- /dev/null
@@ -0,0 +1,441 @@
+//
+// ReadOnlyDictionary.cs
+//
+// Authors:
+//       Martin Baulig <martin.baulig@xamarin.com>
+//       Marek Safar (marek.safar@gmail.com)
+//
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#if NET_4_5
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace System.Collections.ObjectModel {
+
+       [Serializable]
+       [DebuggerDisplay ("Count={Count}")]
+       [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
+       public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary,
+               IReadOnlyDictionary<TKey, TValue>
+       {
+               readonly IDictionary<TKey, TValue> inner;
+
+               public ReadOnlyDictionary (IDictionary<TKey, TValue> dictionary)
+               {
+                       if (dictionary == null)
+                               throw new ArgumentNullException ("dictionary");
+
+                       this.inner = dictionary;
+               }
+
+               protected IDictionary<TKey, TValue> Dictionary {
+                       get {
+                               return inner;
+                       }
+               }
+
+               public bool ContainsKey (TKey key)
+               {
+                       return inner.ContainsKey (key);
+               }
+
+               public bool TryGetValue (TKey key, out TValue value)
+               {
+                       return inner.TryGetValue (key, out value);
+               }
+
+               public TValue this [TKey key] {
+                       get {
+                               return inner [key];
+                       }
+               }
+
+               public KeyCollection Keys {
+                       get {
+                               return new KeyCollection (inner.Keys);
+                       }
+               }
+
+               public ValueCollection Values {
+                       get {
+                               return new ValueCollection (inner.Values);
+                       }
+               }
+
+               #region IEnumerable<KeyValuePair<TKey, TValue>> implementation
+               public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator ()
+               {
+                       return inner.GetEnumerator ();
+               }
+               #endregion
+               #region IEnumerable implementation
+               IEnumerator IEnumerable.GetEnumerator ()
+               {
+                       return inner.GetEnumerator ();
+               }
+               #endregion
+
+               #region IDictionary<TKey, TValue> implementation
+
+               void IDictionary<TKey, TValue>.Add (TKey key, TValue value)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               bool IDictionary<TKey, TValue>.Remove (TKey key)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               TValue IDictionary<TKey, TValue>.this [TKey key] {
+                       get {
+                               return inner [key];
+                       }
+                       set {
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               ICollection<TKey> IDictionary<TKey, TValue>.Keys {
+                       get {
+                               return Keys;
+                       }
+               }
+
+               ICollection<TValue> IDictionary<TKey, TValue>.Values {
+                       get {
+                               return Values;
+                       }
+               }
+
+               #endregion
+
+               #region IDictionary implementation
+
+               void IDictionary.Add (object key, object value)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               void IDictionary.Clear ()
+               {
+                       throw new NotSupportedException ();
+               }
+
+               bool IDictionary.Contains (object key)
+               {
+                       return ((IDictionary)inner).Contains (key);
+               }
+
+               IDictionaryEnumerator IDictionary.GetEnumerator ()
+               {
+                       return ((IDictionary)inner).GetEnumerator ();
+               }
+
+               void IDictionary.Remove (object key)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               bool IDictionary.IsFixedSize {
+                       get {
+                               return true;
+                       }
+               }
+
+               bool IDictionary.IsReadOnly {
+                       get {
+                               return true;
+                       }
+               }
+
+               object IDictionary.this [object key] {
+                       get {
+                               return ((IDictionary)inner)[key];
+                       }
+                       set {
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               ICollection IDictionary.Keys {
+                       get {
+                               return Keys;
+                       }
+               }
+
+               ICollection IDictionary.Values {
+                       get {
+                               return Values;
+                       }
+               }
+
+               #endregion
+
+               #region ICollection implementation
+
+               void ICollection.CopyTo (Array array, int index)
+               {
+                       ((ICollection)inner).CopyTo (array, index);
+               }
+
+               #endregion
+
+               #region ICollection<KeyValuePair<TKey, TValue>> implementation
+
+               void ICollection<KeyValuePair<TKey, TValue>>.Add (KeyValuePair<TKey, TValue> item)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               void ICollection<KeyValuePair<TKey, TValue>>.Clear ()
+               {
+                       throw new NotSupportedException ();
+               }
+
+               bool ICollection<KeyValuePair<TKey, TValue>>.Contains (KeyValuePair<TKey, TValue> item)
+               {
+                       return ((ICollection<KeyValuePair<TKey, TValue>>)inner).Contains (item);
+               }
+
+               void ICollection<KeyValuePair<TKey, TValue>>.CopyTo (KeyValuePair<TKey, TValue>[] array, int arrayIndex)
+               {
+                       ((ICollection<KeyValuePair<TKey, TValue>>)inner).CopyTo (array, arrayIndex);
+               }
+
+               bool ICollection<KeyValuePair<TKey, TValue>>.Remove (KeyValuePair<TKey, TValue> item)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly {
+                       get {
+                               return true;
+                       }
+               }
+
+               #endregion
+
+               #region ICollection implementation
+
+               public int Count {
+                       get {
+                               return inner.Count;
+                       }
+               }
+
+               bool ICollection.IsSynchronized {
+                       get {
+                               return false;
+                       }
+               }
+
+               object ICollection.SyncRoot {
+                       get {
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               #endregion
+
+               IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys {
+                       get {
+                               return Keys;
+                       }
+               }
+
+               IEnumerable<TValue> IReadOnlyDictionary<TKey, TValue>.Values {
+                       get {
+                               return Values;
+                       }
+               }
+
+               [Serializable]
+               [DebuggerDisplay ("Count={Count}")]
+               [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]                
+               public sealed class KeyCollection : ICollection<TKey>, IEnumerable<TKey>, ICollection, IEnumerable
+               {
+                       readonly ICollection<TKey> collection;
+
+                       internal KeyCollection (ICollection<TKey> collection)
+                       {
+                               this.collection = collection;
+                       }
+
+                       public void CopyTo (TKey [] array, int arrayIndex)
+                       {
+                               collection.CopyTo (array, arrayIndex);
+                       }
+
+                       public IEnumerator<TKey> GetEnumerator ()
+                       {
+                               return collection.GetEnumerator ();
+                       }
+
+                       void ICollection<TKey>.Add (TKey item)
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       void ICollection<TKey>.Clear ()
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       bool ICollection<TKey>.Contains (TKey item)
+                       {
+                               return collection.Contains (item);
+                       }
+
+                       bool ICollection<TKey>.Remove (TKey item)
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       void ICollection.CopyTo (Array array, int index)
+                       {
+                               var target = array as TKey [];
+                               if (target != null) {
+                                       CopyTo (target, index);
+                                       return;
+                               }
+
+                               throw new NotImplementedException ();
+                       }
+
+                       IEnumerator IEnumerable.GetEnumerator ()
+                       {
+                               return collection.GetEnumerator ();
+                       }
+
+                       public int Count {
+                               get {
+                                       return collection.Count;
+                               }
+                       }
+
+                       bool ICollection<TKey>.IsReadOnly {
+                               get {
+                                       return true;
+                               }
+                       }
+
+                       bool ICollection.IsSynchronized {
+                               get {
+                                       return false;
+                               }
+                       }
+
+                       object ICollection.SyncRoot {
+                               get {
+                                       throw new NotImplementedException ();
+                               }
+                       }
+               }
+
+               [Serializable]
+               [DebuggerDisplay ("Count={Count}")]
+               [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]                
+               public sealed class ValueCollection : ICollection<TValue>, IEnumerable<TValue>, ICollection, IEnumerable
+               {
+                       readonly ICollection<TValue> collection;
+
+                       internal ValueCollection (ICollection<TValue> collection)
+                       {
+                               this.collection = collection;
+                       }
+
+                       public void CopyTo (TValue [] array, int arrayIndex)
+                       {
+                               collection.CopyTo (array, arrayIndex);
+                       }
+
+                       public IEnumerator<TValue> GetEnumerator ()
+                       {
+                               return collection.GetEnumerator ();
+                       }
+
+                       void ICollection<TValue>.Add (TValue item)
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       void ICollection<TValue>.Clear ()
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       bool ICollection<TValue>.Contains (TValue item)
+                       {
+                               return collection.Contains (item);
+                       }
+
+                       bool ICollection<TValue>.Remove (TValue item)
+                       {
+                               throw new NotSupportedException ("this is a read-only collection");
+                       }
+
+                       void ICollection.CopyTo (Array array, int index)
+                       {
+                               var target = array as TValue [];
+                               if (target != null) {
+                                       CopyTo (target, index);
+                                       return;
+                               }
+
+                               throw new NotImplementedException ();
+                       }
+
+                       IEnumerator IEnumerable.GetEnumerator ()
+                       {
+                               return collection.GetEnumerator ();
+                       }
+
+                       public int Count {
+                               get {
+                                       return collection.Count;
+                               }
+                       }
+
+                       bool ICollection<TValue>.IsReadOnly {
+                               get {
+                                       return true;
+                               }
+                       }
+
+                       bool ICollection.IsSynchronized {
+                               get {
+                                       return false;
+                               }
+                       }
+
+                       object ICollection.SyncRoot {
+                               get {
+                                       throw new NotImplementedException ();
+                               }
+                       }
+               }
+       }
+}
+#endif
+
index 95ba4ee3d3e8663d01355d87c76a79103e2becde..57c33d3732bb2dfcd6b6759d079e835ca34f666a 100644 (file)
@@ -222,6 +222,8 @@ namespace System.IO {
 
                                if (l >= 2 && DirectorySeparatorChar == '\\' && ret [l - 1] == VolumeSeparatorChar)
                                        return ret + DirectorySeparatorChar;
+                               else if (l == 1 && DirectorySeparatorChar == '\\' && path.Length >= 2 && path [nLast] == VolumeSeparatorChar)
+                                       return ret + VolumeSeparatorChar;
                                else {
                                        //
                                        // Important: do not use CanonicalizePath here, use
index fe715c33796233ea472fbb0adb2146bd10c3d931..cf2e6f23efcfd5758a60892787b165434656fbbc 100644 (file)
@@ -149,7 +149,10 @@ public abstract class Decoder
                out int bytesUsed, out int charsUsed, out bool completed)
        {
                CheckArguments (bytes, byteIndex, byteCount);
-               CheckArguments (chars, charIndex);
+               if (chars == null)
+                       throw new ArgumentNullException ("chars");
+               if (charIndex < 0)
+                       throw new ArgumentOutOfRangeException ("charIndex");
                if (charCount < 0 || chars.Length < charIndex + charCount)
                        throw new ArgumentOutOfRangeException ("charCount");
 
@@ -169,7 +172,7 @@ public abstract class Decoder
        {
                if (chars == null)
                        throw new ArgumentNullException ("chars");
-               if (charIndex < 0 || chars.Length <= charIndex)
+               if (charIndex < 0 || chars.Length < charIndex)
                        throw new ArgumentOutOfRangeException ("charIndex");
        }
 
@@ -177,7 +180,7 @@ public abstract class Decoder
        {
                if (bytes == null)
                        throw new ArgumentNullException ("bytes");
-               if (byteIndex < 0 || bytes.Length <= byteIndex)
+               if (byteIndex < 0)
                        throw new ArgumentOutOfRangeException ("byteIndex");
                if (byteCount < 0 || bytes.Length < byteIndex + byteCount)
                        throw new ArgumentOutOfRangeException ("byteCount");
index fd5e83be04e2305a2e4f14d198fe4e660401b196..bdd80e8a626a9d4de5b562c29e5a09807e85545b 100644 (file)
@@ -663,7 +663,7 @@ fail_no_space:
                        throw new ArgumentOutOfRangeException ("charIndex", _("ArgRange_Array"));
                }
 
-               if (charIndex == chars.Length)
+               if (charIndex == chars.Length && byteCount == 0)
                        return 0;
 
                fixed (char* cptr = chars) {
@@ -688,10 +688,14 @@ fail_no_space:
                if (leftOverCount == 0) {
                        int end = byteIndex + byteCount;
                        for (; byteIndex < end; posn++, byteIndex++, byteCount--) {
-                               if (bytes [byteIndex] < 0x80)
+                               if (bytes [byteIndex] < 0x80) {
+                                       if (posn >= length) {
+                                               throw new ArgumentException (_("Arg_InsufficientSpace"), "chars");
+                                       }
                                        chars [posn] = (char) bytes [byteIndex];
-                               else
+                               } else {
                                        break;
+                               }
                        }
                }
 
index fb53d803b883c045db88533b7833a384a233501c..77822ac98c4028920e8e3794497f0e6254bc409d 100644 (file)
@@ -280,6 +280,8 @@ namespace MonoTests.System.IO
                                Assert.AreEqual (@"C:\dir", Path.GetDirectoryName (@"C:\dir\"), "#B5");
                                Assert.AreEqual (@"C:\dir", Path.GetDirectoryName (@"C:\dir\dir"), "#B6");
                                Assert.AreEqual (@"C:\dir\dir", Path.GetDirectoryName (@"C:\dir\dir\"), "#B7");
+                               Assert.AreEqual (@"C:", Path.GetDirectoryName (@"C:foo.txt"), "#B8");
+                               Assert.AreEqual (@"C:dir", Path.GetDirectoryName (@"C:dir\"), "#B9");
 
                                Assert.AreEqual ("\\foo\\bar", Path.GetDirectoryName ("/foo//bar/dingus"), "#C1");
                                Assert.AreEqual ("foo\\bar", Path.GetDirectoryName ("foo/bar/"), "#C2");
index 3da0846360b0866e32f3a8fdb3512cd1212be50e..6cf0306d823257437d538dd85defcf95b6710516 100644 (file)
@@ -98,5 +98,22 @@ namespace MonoTests.System.Text
                        }
                }
 #endif
+
+               [Test]
+               public void Bug10789 ()
+               {
+                       byte[] bytes = new byte[100];
+                       char[] chars = new char[100];  
+
+                       Decoder conv = Encoding.UTF8.GetDecoder ();
+                       int charsUsed, bytesUsed;
+                       bool completed;
+                       
+                       conv.Convert (bytes, 0, 0, chars, 100, 0, false, out bytesUsed, out charsUsed, out completed);
+
+                       Assert.IsTrue (completed, "#1");
+                       Assert.AreEqual (0, charsUsed, "#2");
+                       Assert.AreEqual (0, bytesUsed, "#3");
+               }
        }
 }
index 0b0ae720602b421300f53c519d6376a72c3bf562..1f53af7e3eb278bf0d91e8055f74da125d866764 100644 (file)
@@ -1164,5 +1164,37 @@ namespace MonoTests.System.Text
                        }
                }
 #endif
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void Bug10788()
+               {
+                       byte[] bytes = new byte[4096];
+                       char[] chars = new char[10];
+
+                       Encoding.UTF8.GetDecoder ().GetChars (bytes, 0, 4096, chars, 9, false);
+               }
+
+               [Test]
+               public void Bug10789()
+               {
+                       byte[] bytes = new byte[4096];
+                       char[] chars = new char[10];
+
+                       try {
+                               Encoding.UTF8.GetDecoder ().GetChars (bytes, 0, 1, chars, 10, false);
+                               Assert.Fail ("ArgumentException is expected #1");
+                       } catch (ArgumentException) {
+                       }
+
+                       try {
+                               Encoding.UTF8.GetDecoder ().GetChars (bytes, 0, 1, chars, 11, false);
+                               Assert.Fail ("ArgumentOutOfRangeException is expected #2");
+                       } catch (ArgumentOutOfRangeException) {
+                       }
+
+                       int charactersWritten = Encoding.UTF8.GetDecoder ().GetChars (bytes, 0, 0, chars, 10, false);
+                       Assert.AreEqual (0, charactersWritten, "#3");
+               }
        }
 }
index eafb48667df32c08f73d5c6c6c99c1f463c43232..4d9560fc1385763a1b461211331d60df0fe7ed31 100644 (file)
@@ -1562,6 +1562,7 @@ System.Collections.Generic/List.cs
 System.Collections.ObjectModel/Collection.cs
 System.Collections.ObjectModel/KeyedCollection.cs
 System.Collections.ObjectModel/ReadOnlyCollection.cs
+System.Collections.ObjectModel/ReadOnlyDictionary.cs
 System/Action.cs
 System/ArraySegment.cs
 System/Comparison.cs
index b6db15ad2e2718e3cf5d50de033de38ff4b3604d..ddb304be98628f4044924a79b23976d52a3468b3 100644 (file)
@@ -64,7 +64,7 @@ namespace System.Linq.Expressions.Compiler {
         internal readonly HoistedLocals Parent;
 
         // A mapping of hoisted variables to their indexes in the array
-        internal readonly ReadOnlyDictionary<Expression, int> Indexes;
+        internal readonly System.Dynamic.Utils.ReadOnlyDictionary<Expression, int> Indexes;
 
         // The variables, in the order they appear in the array
         internal readonly ReadOnlyCollection<ParameterExpression> Variables;
@@ -87,7 +87,7 @@ namespace System.Linq.Expressions.Compiler {
             SelfVariable = Expression.Variable(typeof(object[]), null);
             Parent = parent;
             Variables = vars;
-            Indexes = new ReadOnlyDictionary<Expression, int>(indexes);
+            Indexes = new System.Dynamic.Utils.ReadOnlyDictionary<Expression, int>(indexes);
         }
 
         internal ParameterExpression ParentVariable {
index ce206ab33ba8749ea0e409dbf6f2993c8baf1eb1..25157c097d6f32562f7fac2e028fa61d6fa44076 100644 (file)
@@ -643,6 +643,7 @@ typedef struct {
        gconstpointer wrapper;
        gconstpointer trampoline;
        MonoMethodSignature *sig;
+       const char *c_symbol;
 } MonoJitICallInfo;
 
 typedef struct {
@@ -1196,6 +1197,9 @@ mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
 MonoJitICallInfo *
 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
 
+MonoJitICallInfo *
+mono_register_jit_icall_full (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save, const char *c_symbol) MONO_INTERNAL;
+
 void
 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
 
@@ -1208,6 +1212,9 @@ mono_find_jit_icall_by_addr (gconstpointer addr) MONO_LLVM_INTERNAL;
 GHashTable*
 mono_get_jit_icall_info (void) MONO_INTERNAL;
 
+const char*
+mono_lookup_jit_icall_symbol (const char *name) MONO_INTERNAL;
+
 gboolean
 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
 
index 94abd5bf2f4d22c97c3b6e0981ba97a8a82248a9..7c0771aad16ffe1a2505f79c9cbd057c9f18d91a 100644 (file)
@@ -1170,7 +1170,7 @@ ves_icall_System_Object_GetType (MonoObject *obj)
        MONO_ARCH_SAVE_REGS;
 
 #ifndef DISABLE_REMOTING
-       if (obj->vtable->klass == mono_defaults.transparent_proxy_class)
+       if (obj->vtable->klass != mono_defaults.transparent_proxy_class)
                return mono_type_get_object (mono_object_domain (obj), &((MonoTransparentProxy*)obj)->remote_class->proxy_class->byval_arg);
        else
 #endif
@@ -8395,6 +8395,25 @@ mono_get_jit_icall_info (void)
        return jit_icall_hash_name;
 }
 
+/*
+ * mono_lookup_jit_icall_symbol:
+ *
+ *   Given the jit icall NAME, returns its C symbol if possible, or NULL.
+ */
+const char*
+mono_lookup_jit_icall_symbol (const char *name)
+{
+       MonoJitICallInfo *info;
+       const char *res = NULL;
+
+       mono_loader_lock ();
+       info = g_hash_table_lookup (jit_icall_hash_name, name);
+       if (info)
+               res = info->c_symbol;
+       mono_loader_unlock ();
+       return res;
+}
+
 void
 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper)
 {
@@ -8404,7 +8423,7 @@ mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper)
 }
 
 MonoJitICallInfo *
-mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save)
+mono_register_jit_icall_full (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save, const char *c_symbol)
 {
        MonoJitICallInfo *info;
        
@@ -8428,6 +8447,7 @@ mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignatu
        info->name = name;
        info->func = func;
        info->sig = sig;
+       info->c_symbol = c_symbol;
 
        if (is_save) {
                info->wrapper = func;
@@ -8441,3 +8461,10 @@ mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignatu
        mono_loader_unlock ();
        return info;
 }
+
+MonoJitICallInfo *
+mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save)
+{
+       return mono_register_jit_icall_full (func, name, sig, is_save, NULL);
+}
+
index c0a81b341f499345d94144762cce30e754580af5..865aa9270cb6a5767ba3b38120b51b5cc6d3c4fb 100644 (file)
@@ -8636,21 +8636,26 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
 
        mb->method->save_lmf = 1;
 
-#ifndef DISABLE_JIT
        /*
         * In AOT mode and embedding scenarios, it is possible that the icall is not
         * registered in the runtime doing the AOT compilation.
         */
        if (!piinfo->addr && !aot) {
+#ifndef DISABLE_JIT
                mono_mb_emit_exception (mb, exc_class, exc_arg);
+#endif
                csig = signature_dup (method->klass->image, sig);
                csig->pinvoke = 0;
                res = mono_mb_create_and_cache (cache, method,
                                                                                mb, csig, csig->param_count + 16);
                mono_mb_free (mb);
+
+               info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NONE);
+               info->d.managed_to_native.method = method;
+               mono_marshal_set_wrapper_info (res, info);
+
                return res;
        }
-#endif
 
        /* internal calls: we simply push all arguments and call the method (no conversions) */
        if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
index 3eadd2f45effe992d414eea27d47947755af78db..61af478f6f248087fb9b12205e35aebd7bbd3508 100644 (file)
@@ -210,6 +210,7 @@ typedef struct MonoAotCompile {
        char *plt_symbol;
        GHashTable *method_label_hash;
        const char *temp_prefix;
+       const char *user_symbol_prefix;
        const char *llvm_label_prefix;
        guint32 label_generator;
        gboolean llvm;
@@ -589,6 +590,7 @@ arch_init (MonoAotCompile *acfg)
         * symbols.
         */
        acfg->llvm_label_prefix = "";
+       acfg->user_symbol_prefix = "";
 
 #ifdef TARGET_ARM
        if (acfg->aot_opts.mtriple && strstr (acfg->aot_opts.mtriple, "darwin")) {
@@ -609,6 +611,7 @@ arch_init (MonoAotCompile *acfg)
 #endif
 
 #ifdef TARGET_MACH
+       acfg->user_symbol_prefix = "_";
        acfg->llvm_label_prefix = "_";
        acfg->need_no_dead_strip = TRUE;
 #endif
@@ -630,11 +633,11 @@ arch_init (MonoAotCompile *acfg)
  * calling code.
  */
 static void
-arch_emit_direct_call (MonoAotCompile *acfg, const char *target, int *call_size)
+arch_emit_direct_call (MonoAotCompile *acfg, const char *target, gboolean external, int *call_size)
 {
 #if defined(TARGET_X86) || defined(TARGET_AMD64)
        /* Need to make sure this is exactly 5 bytes long */
-       if (FALSE && !acfg->use_bin_writer) {
+       if (external && !acfg->use_bin_writer) {
                img_writer_emit_unset_mode (acfg->w);
                fprintf (acfg->fp, "call %s\n", target);
        } else {
@@ -4145,7 +4148,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
        GPtrArray *patches;
        MonoJumpInfo *patch_info;
        MonoMethodHeader *header;
-       gboolean skip, direct_call;
+       gboolean skip, direct_call, external_call;
        guint32 got_slot;
        const char *direct_call_target;
        const char *direct_pinvoke;
@@ -4195,6 +4198,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
                                 * the same assembly and requires no initialization.
                                 */
                                direct_call = FALSE;
+                               external_call = FALSE;
                                if ((patch_info->type == MONO_PATCH_INFO_METHOD) && (patch_info->data.method->klass->image == acfg->image)) {
                                        if (!got_only && is_direct_callable (acfg, method, patch_info)) {
                                                MonoCompile *callee_cfg = g_hash_table_lookup (acfg->method_to_cfg, patch_info->data.method);
@@ -4213,17 +4217,19 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
                                                else
                                                        direct_pinvoke = get_pinvoke_import (acfg, patch_info->data.method);
                                                if (direct_pinvoke) {
-                                                       const char*prefix;
-#if defined(TARGET_MACH)
-                                                       prefix = "_";
-#else
-                                                       prefix = "";
-#endif
                                                        direct_call = TRUE;
                                                        g_assert (strlen (direct_pinvoke) < 1000);
-                                                       direct_call_target = g_strdup_printf ("%s%s", prefix, direct_pinvoke);
+                                                       direct_call_target = g_strdup_printf ("%s%s", acfg->user_symbol_prefix, direct_pinvoke);
                                                }
                                        }
+                               } else if (patch_info->type == MONO_PATCH_INFO_INTERNAL_METHOD) {
+                                       const char *sym = mono_lookup_jit_icall_symbol (patch_info->data.name);
+                                       if (sym && acfg->aot_opts.direct_icalls) {
+                                               direct_call = TRUE;
+                                               external_call = TRUE;
+                                               g_assert (strlen (sym) < 1000);
+                                               direct_call_target = g_strdup_printf ("%s%s", acfg->user_symbol_prefix, sym);
+                                       }
                                }
 
                                if (direct_call) {
@@ -4247,7 +4253,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
                                if (direct_call) {
                                        int call_size;
 
-                                       arch_emit_direct_call (acfg, direct_call_target, &call_size);
+                                       arch_emit_direct_call (acfg, direct_call_target, external_call, &call_size);
                                        i += call_size - 1;
                                } else {
                                        int code_size;
@@ -4431,6 +4437,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
                encode_value (get_image_index (acfg, patch_info->data.image), p, &p);
                break;
        case MONO_PATCH_INFO_MSCORLIB_GOT_ADDR:
+       case MONO_PATCH_INFO_JIT_TLS_ID:
        case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
                break;
@@ -8173,6 +8180,10 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile));
                ji->type = MONO_PATCH_INFO_GC_CARD_TABLE_ADDR;
                get_got_offset (acfg, ji);
+
+               ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile));
+               ji->type = MONO_PATCH_INFO_JIT_TLS_ID;
+               get_got_offset (acfg, ji);
        }
 
        TV_GETTIME (atv);
index cd164ebd71d6e8eb0ac030d318215342ef3a68fa..e08d90fbde52d6ff4a8693770d40fe015c52690f 100644 (file)
@@ -2885,6 +2885,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin
        case MONO_PATCH_INFO_MONITOR_EXIT:
        case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
+       case MONO_PATCH_INFO_JIT_TLS_ID:
                break;
        case MONO_PATCH_INFO_RGCTX_FETCH: {
                gboolean res;
index e6d6d928142b51340c5c74658219982eb448b4ca..94ca5b5ca33b0302d5c5d3e73af76f31c2a8ad21 100644 (file)
@@ -1586,8 +1586,11 @@ asm_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
 {
        asm_writer_emit_unset_mode (acfg);
 #if  ((defined(__ppc__) || defined(TARGET_X86)) && defined(TARGET_ASM_APPLE)) || (defined(HOST_WIN32) && !defined(MONO_CROSS_COMPILE))
-    // mach-o always uses a '_' prefix.
-       fprintf (acfg->fp, "\t.globl _%s\n", name);
+       if (name[0] != '_')
+               // mach-o always uses a '_' prefix.
+               fprintf (acfg->fp, "\t.globl _%s\n", name);
+       else
+               fprintf (acfg->fp, "\t.globl %s\n", name);
 #else
        fprintf (acfg->fp, "\t.globl %s\n", name);
 #endif
index ec1d943550dc4709ecf246f9ced46a72ea25c3b8..eabff5c1c5c98ef4aa4d5404ed65e2ea73374ee2 100644 (file)
@@ -385,7 +385,7 @@ emit_save_lmf (MonoCompile *cfg, guint8 *code, gint32 lmf_offset)
        if (lmf_addr_tls_offset != -1) {
                get_lmf_fast = TRUE;
 
-               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, 
+               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
                                                         (gpointer)"__aeabi_read_tp");
                code = emit_call_seq (cfg, code);
 
@@ -393,9 +393,38 @@ emit_save_lmf (MonoCompile *cfg, guint8 *code, gint32 lmf_offset)
                get_lmf_fast = TRUE;
        }
 #endif
+
+#ifdef TARGET_IOS
+       if (cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) {
+               int lmf_offset;
+
+               /* Inline mono_get_lmf_addr () */
+               /* jit_tls = pthread_getspecific (mono_jit_tls_id); lmf_addr = &jit_tls->lmf; */
+
+               /* Load mono_jit_tls_id */
+               /* OP_AOTCONST */
+               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_JIT_TLS_ID, NULL);
+               ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
+               ARM_B (code, 0);
+               *(gpointer*)code = NULL;
+               code += 4;
+               ARM_LDR_REG_REG (code, ARMREG_R0, ARMREG_PC, ARMREG_R0);
+               /* call pthread_getspecific () */
+               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, 
+                                                        (gpointer)"pthread_getspecific");
+               code = emit_call_seq (cfg, code);
+               /* lmf_addr = &jit_tls->lmf */
+               lmf_offset = G_STRUCT_OFFSET (MonoJitTlsData, lmf);
+               g_assert (arm_is_imm8 (lmf_offset));
+               ARM_ADD_REG_IMM (code, ARMREG_R0, ARMREG_R0, lmf_offset, 0);
+
+               get_lmf_fast = TRUE;
+       }
+#endif
+
        if (!get_lmf_fast) {
                mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, 
-                                                                (gpointer)"mono_get_lmf_addr");
+                                                        (gpointer)"mono_get_lmf_addr");
                code = emit_call_seq (cfg, code);
        }
        /* we build the MonoLMF structure on the stack - see mini-arm.h */
index 998a8f54fc6c3f11f1f87b2c58774c941b326246..214a5c285519875f55dd7750c3eb244be4942f5e 100644 (file)
@@ -2315,11 +2315,28 @@ mono_register_opcode_emulation (int opcode, const char *name, const char *sigstr
        emul_opcode_hit_cache [opcode >> (EMUL_HIT_SHIFT + 3)] |= (1 << (opcode & EMUL_HIT_MASK));
 }
 
+/*
+ * For JIT icalls implemented in C.
+ * NAME should be the same as the name of the C function whose address is FUNC.
+ */
 static void
 register_icall (gpointer func, const char *name, const char *sigstr, gboolean save)
 {
        MonoMethodSignature *sig;
 
+       if (sigstr)
+               sig = mono_create_icall_signature (sigstr);
+       else
+               sig = NULL;
+
+       mono_register_jit_icall_full (func, name, sig, save, save ? name : NULL);
+}
+
+static void
+register_dyn_icall (gpointer func, const char *name, const char *sigstr, gboolean save)
+{
+       MonoMethodSignature *sig;
+
        if (sigstr)
                sig = mono_create_icall_signature (sigstr);
        else
@@ -2582,7 +2599,8 @@ mono_get_lmf_addr (void)
 #else
        MonoJitTlsData *jit_tls;
 
-       if ((jit_tls = mono_native_tls_get_value (mono_jit_tls_id)))
+       jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+       if (G_LIKELY (jit_tls))
                return &jit_tls->lmf;
 
        /*
@@ -3344,6 +3362,10 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                target = mono_domain_alloc0 (domain, sizeof (gpointer));
                break;
        }
+       case MONO_PATCH_INFO_JIT_TLS_ID: {
+               target = (gpointer)mono_jit_tls_id;
+               break;
+       }
        default:
                g_assert_not_reached ();
        }
@@ -6907,10 +6929,9 @@ mini_init (const char *filename, const char *runtime_version)
        register_icall (mono_jit_set_domain, "mono_jit_set_domain", "void ptr", TRUE);
        register_icall (mono_domain_get, "mono_domain_get", "ptr", TRUE);
 
-       register_icall (mono_get_throw_exception (), "mono_arch_throw_exception", "void object", TRUE);
-       register_icall (mono_get_rethrow_exception (), "mono_arch_rethrow_exception", "void object", TRUE);
-       register_icall (mono_get_throw_corlib_exception (), "mono_arch_throw_corlib_exception", 
-                                "void ptr", TRUE);
+       register_dyn_icall (mono_get_throw_exception (), "mono_arch_throw_exception", "void object", TRUE);
+       register_dyn_icall (mono_get_rethrow_exception (), "mono_arch_rethrow_exception", "void object", TRUE);
+       register_dyn_icall (mono_get_throw_corlib_exception (), "mono_arch_throw_corlib_exception", "void ptr", TRUE);
        register_icall (mono_thread_get_undeniable_exception, "mono_thread_get_undeniable_exception", "object", FALSE);
        register_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", "void", FALSE);
        register_icall (mono_thread_force_interruption_checkpoint, "mono_thread_force_interruption_checkpoint", "void", FALSE);
@@ -7048,7 +7069,7 @@ mini_init (const char *filename, const char *runtime_version)
                "ptr ptr ptr ptr", FALSE);
        register_icall (mono_get_special_static_data, "mono_get_special_static_data", "ptr int", FALSE);
        register_icall (mono_ldstr, "mono_ldstr", "object ptr ptr int32", FALSE);
-       register_icall (mono_helper_stelem_ref_check, "helper_stelem_ref_check", "void object object", FALSE);
+       register_icall (mono_helper_stelem_ref_check, "mono_helper_stelem_ref_check", "void object object", FALSE);
        register_icall (mono_object_new, "mono_object_new", "object ptr ptr", FALSE);
        register_icall (mono_object_new_specific, "mono_object_new_specific", "object ptr", FALSE);
        register_icall (mono_array_new, "mono_array_new", "object ptr ptr int32", FALSE);
@@ -7057,10 +7078,10 @@ mini_init (const char *filename, const char *runtime_version)
        register_icall (mono_ldftn, "mono_ldftn", "ptr ptr", FALSE);
        register_icall (mono_ldvirtfn, "mono_ldvirtfn", "ptr object ptr", FALSE);
        register_icall (mono_ldvirtfn_gshared, "mono_ldvirtfn_gshared", "ptr object ptr", FALSE);
-       register_icall (mono_helper_compile_generic_method, "compile_generic_method", "ptr object ptr ptr", FALSE);
-       register_icall (mono_helper_ldstr, "helper_ldstr", "object ptr int", FALSE);
-       register_icall (mono_helper_ldstr_mscorlib, "helper_ldstr_mscorlib", "object int", FALSE);
-       register_icall (mono_helper_newobj_mscorlib, "helper_newobj_mscorlib", "object int", FALSE);
+       register_icall (mono_helper_compile_generic_method, "mono_helper_compile_generic_method", "ptr object ptr ptr", FALSE);
+       register_icall (mono_helper_ldstr, "mono_helper_ldstr", "object ptr int", FALSE);
+       register_icall (mono_helper_ldstr_mscorlib, "mono_helper_ldstr_mscorlib", "object int", FALSE);
+       register_icall (mono_helper_newobj_mscorlib, "mono_helper_newobj_mscorlib", "object int", FALSE);
        register_icall (mono_value_copy, "mono_value_copy", "void ptr ptr ptr", FALSE);
        register_icall (mono_object_castclass, "mono_object_castclass", "object object ptr", FALSE);
        register_icall (mono_break, "mono_break", NULL, TRUE);
@@ -7082,7 +7103,10 @@ mini_init (const char *filename, const char *runtime_version)
        register_icall (mono_object_isinst_with_cache, "mono_object_isinst_with_cache", "object object ptr ptr", FALSE);
 
        register_icall (mono_debugger_agent_user_break, "mono_debugger_agent_user_break", "void", FALSE);
+#endif
 
+#ifdef TARGET_IOS
+       register_icall (pthread_getspecific, "pthread_getspecific", NULL, TRUE);
 #endif
 
        mono_generic_sharing_init ();
index 53800be31bb64b78d7635fdb8f7c5e931ae1325d..b7fd39d808133ebd4cdfb8f93f330c698b02bde9 100644 (file)
@@ -44,4 +44,6 @@ PATCH_INFO(GC_CARD_TABLE_ADDR, "gc_card_table_addr")
 PATCH_INFO(CASTCLASS_CACHE, "castclass_cache")
 PATCH_INFO(SIGNATURE, "signature")
 PATCH_INFO(GSHAREDVT_CALL, "gsharedvt_call")
+PATCH_INFO(JIT_TLS_ID, "jit_tls_id")
 PATCH_INFO(NONE, "none")
+
index 8140a85c0ae12f0e04abad3193fa0541b70b6d94..d1114019bdf653f49b1a090f928816887ebdd3d2 100644 (file)
@@ -121,7 +121,6 @@ Global
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Debug|x64.ActiveCfg = Debug|x64\r
-               {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Debug|x64.Build.0 = Debug|x64\r
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {C5639B3F-288A-4A4B-A4A5-C0D85834221D}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -131,7 +130,6 @@ Global
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Debug|x64.ActiveCfg = Debug|x64\r
-               {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Debug|x64.Build.0 = Debug|x64\r
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {6FDE4E5E-57D0-432F-A987-6C226A7827E4}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -171,7 +169,6 @@ Global
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Debug|x64.ActiveCfg = Debug|x64\r
-               {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Debug|x64.Build.0 = Debug|x64\r
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {37F50E5A-4818-46CF-81FE-4BB06DE5D42E}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -181,7 +178,6 @@ Global
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Debug|x64.ActiveCfg = Debug|x64\r
-               {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Debug|x64.Build.0 = Debug|x64\r
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {84C7DB50-D6F8-4C47-B22C-6BB203AEB4D3}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -191,19 +187,16 @@ Global
                {8F90007F-8019-4191-8808-891E4762D958}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {8F90007F-8019-4191-8808-891E4762D958}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {8F90007F-8019-4191-8808-891E4762D958}.Debug|x64.ActiveCfg = Debug|x64\r
-               {8F90007F-8019-4191-8808-891E4762D958}.Debug|x64.Build.0 = Debug|x64\r
                {8F90007F-8019-4191-8808-891E4762D958}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {8F90007F-8019-4191-8808-891E4762D958}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {8F90007F-8019-4191-8808-891E4762D958}.Release_SGen|x64.Build.0 = Release|x64\r
                {8F90007F-8019-4191-8808-891E4762D958}.Release|Win32.ActiveCfg = Release|Win32\r
                {8F90007F-8019-4191-8808-891E4762D958}.Release|x64.ActiveCfg = Release|x64\r
-               {8F90007F-8019-4191-8808-891E4762D958}.Release|x64.Build.0 = Release|x64\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug_SGen|Win32.ActiveCfg = Debug|Win32\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug_SGen|x64.ActiveCfg = Debug|x64\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug|x64.ActiveCfg = Debug|x64\r
-               {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Debug|x64.Build.0 = Debug|x64\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {CA2A69D6-3B9D-45A5-8BF7-4E242E683122}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -213,7 +206,6 @@ Global
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Debug|x64.ActiveCfg = Debug|x64\r
-               {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Debug|x64.Build.0 = Debug|x64\r
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {C2EB666E-9146-4B7A-85F6-25F9EA313770}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -238,7 +230,6 @@ Global
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Debug|x64.ActiveCfg = Debug|x64\r
-               {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Debug|x64.Build.0 = Debug|x64\r
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Release_SGen|x64.ActiveCfg = Release|x64\r
                {80A0620A-3478-4E1A-AA7C-0D2387B892AB}.Release|Win32.ActiveCfg = Release|Win32\r
@@ -333,7 +324,8 @@ Global
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug_SGen|x64.Build.0 = Debug|x64\r
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug|Win32.Build.0 = Debug|Win32\r
-               {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug|x64.ActiveCfg = Debug|x64\r
+               {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Debug|x64.Build.0 = Debug|x64\r
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Release_SGen|Win32.ActiveCfg = Release|Win32\r
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Release_SGen|Win32.Build.0 = Release|Win32\r
                {8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}.Release_SGen|x64.ActiveCfg = Release|x64\r
@@ -348,7 +340,8 @@ Global
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug_SGen|x64.Build.0 = Debug_SGen|x64\r
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug|Win32.Build.0 = Debug|Win32\r
-               {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug|x64.ActiveCfg = Debug|x64\r
+               {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Debug|x64.Build.0 = Debug|x64\r
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Release_SGen|Win32.ActiveCfg = Release_SGen|Win32\r
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Release_SGen|Win32.Build.0 = Release_SGen|Win32\r
                {C36612BD-22D3-4B95-85E2-7FDC4FC5D739}.Release_SGen|x64.ActiveCfg = Release_SGen|x64\r