Merge branch 'upstream'

Former-commit-id: e7bc2ce2160572963daa967ada44d8997bf83a6d
This commit is contained in:
Xamarin Public Jenkins
2015-12-18 19:43:16 -05:00
45 changed files with 399 additions and 122 deletions

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "4.2.1.0";
public const string MonoVersion = "4.2.2.0";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -1263,20 +1263,29 @@ namespace System.Data.SqlClient
throw new ArgumentNullException ("values");
int len = values.Length;
int bigDecimalIndex = command.Tds.ColumnValues.BigDecimalIndex;
var tds = command.Tds;
int columns = Math.Min (len, tds.Columns.Count);
// If a four-byte decimal is stored, then we can't convert to
// a native type. Throw an OverflowException.
if (bigDecimalIndex >= 0 && bigDecimalIndex < len)
throw new OverflowException ();
try {
command.Tds.ColumnValues.CopyTo (0, values, 0,
len > command.Tds.ColumnValues.Count ? command.Tds.ColumnValues.Count : len);
} catch (TdsInternalException ex) {
command.Connection.Close ();
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
if ((command.CommandBehavior & CommandBehavior.SequentialAccess) != 0) {
for (int i = 0; i < columns; ++i) {
values [i] = tds.GetSequentialColumnValue (i);
}
} else {
int bigDecimalIndex = tds.ColumnValues.BigDecimalIndex;
// If a four-byte decimal is stored, then we can't convert to
// a native type. Throw an OverflowException.
if (bigDecimalIndex >= 0 && bigDecimalIndex < len)
throw new OverflowException ();
try {
tds.ColumnValues.CopyTo (0, values, 0, columns);
} catch (TdsInternalException ex) {
command.Connection.Close ();
throw SqlException.FromTdsInternalException ((TdsInternalException)ex);
}
}
return (len < FieldCount ? len : FieldCount);
return columns;
}

View File

@ -36,7 +36,10 @@ namespace System
return false;
var from = Type.GetTypeCode (source);
switch (Type.GetTypeCode (target)) {
var to = Type.GetTypeCode (target);
if (from == to && source.IsPrimitive)
return true;
switch (to) {
case TypeCode.Char:
switch (from) {
case TypeCode.Byte:
@ -146,4 +149,4 @@ namespace System
return st == type || CanConvertPrimitive ((RuntimeType) st, type);
}
}
}
}

View File

@ -102,17 +102,7 @@ namespace System
public MethodInfo Method {
get {
if (method_info != null) {
return method_info;
} else {
if (method != IntPtr.Zero) {
if (!method_is_virtual)
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
else
method_info = GetVirtualMethod_internal ();
}
return method_info;
}
return GetMethodImpl ();
}
}
@ -511,7 +501,17 @@ namespace System
protected virtual MethodInfo GetMethodImpl ()
{
return Method;
if (method_info != null) {
return method_info;
} else {
if (method != IntPtr.Zero) {
if (!method_is_virtual)
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
else
method_info = GetVirtualMethod_internal ();
}
return method_info;
}
}
// This is from ISerializable

View File

@ -33,6 +33,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
@ -112,6 +113,14 @@ namespace System
return base.GetHashCode ();
}
protected override MethodInfo GetMethodImpl ()
{
if (delegates != null)
return delegates [delegates.Length - 1].Method;
return base.GetMethodImpl ();
}
// <summary>
// Return, in order of invocation, the invocation list
// of a MulticastDelegate

View File

@ -855,6 +855,32 @@ namespace MonoTests.System.Threading
Assert.AreSame (Thread.GetNamedDataSlot ("te#st"), Thread.GetNamedDataSlot ("te#st"), "#2");
}
class DomainClass : MarshalByRefObject {
Thread m_thread;
bool success;
public bool Run () {
m_thread = new Thread(ThreadProc);
m_thread.Start(Thread.CurrentThread);
m_thread.Join();
return success;
}
public void ThreadProc (object arg) {
success = m_thread == Thread.CurrentThread;
}
}
[Test]
public void CurrentThread_Domains ()
{
AppDomain ad = AppDomain.CreateDomain ("foo");
ad.Load (typeof (DomainClass).Assembly.GetName ());
var o = (DomainClass)ad.CreateInstanceAndUnwrap (typeof (DomainClass).Assembly.FullName, typeof (DomainClass).FullName);
Assert.IsTrue (o.Run ());
AppDomain.Unload (ad);
}
void CheckIsRunning (string s, Thread t)
{
int c = counter;

View File

@ -1 +1 @@
9f87bcd74d19a29f1b4e41b2d7171f2c1af2835c
bc4d15d32cfe0aba953847153e27ae46f18e35c1

View File

@ -1 +1 @@
06f7fdab7429fe3c9ed22771dfe9380d208f037d
b937698af090202f18c31201001eb77a3e464dc5

View File

@ -1 +1 @@
f41bbb4a396f59eec461720dfc065f676523d1c1
3fa77ec9258a44fd81c7433c3534093f2984d1cf

View File

@ -1 +1 @@
ff03cd74a2624bd0a4a51658bb41e7d90f3144c9
b656909fcd7c7447aa1b8639357c6c089a918a74

View File

@ -1 +1 @@
d8009a94148589526c8dc39f0e1c0ca9e77217e8
ec8668e105a38b35bf91110fe79e06e0dca1ead6

View File

@ -1 +1 @@
22fc25a9bdf68807d3d57dc73d711bbd3bc8bc79
47b95db8a26f7b940063993c07b77a5ee36746fe

View File

@ -1 +1 @@
f815830cd5626bb85f053420b1d6fcf19e0aeb2a
3c2d3fbe2cac6adc7835cf53aa766fffd4381e86

View File

@ -0,0 +1,13 @@
class M
{
public static void Main ()
{
string s = null;
s?.CompareTo ("xx").CompareTo(s?.EndsWith ("x")).GetHashCode ();
string s1 = "abcd";
string s2 = null;
var idx = s1.Substring(1)[s2?.GetHashCode () ?? 0].GetHashCode ();
}
}

View File

@ -1 +1 @@
08b0ee8ce9da391ffa51e1cc3eb0a3611adf5b5e
7e6d08d8664395f0f877e388bd40276cefe0c2e9