Imported Upstream version 4.4.0.142

Former-commit-id: 08ca4d6ded648b2ac2eb817c12d5723b52edbb16
This commit is contained in:
Xamarin Public Jenkins 2016-04-28 08:44:23 -04:00
parent d444f0caa4
commit 67cc8417df
39 changed files with 187 additions and 47 deletions

View File

@ -1 +1 @@
25ac5dd52e897440dac529dfcfe2034bdae89d53 da368cb9ffc9b4bfa0f5e04be9f4f6089f689736

View File

@ -1 +1 @@
3decb1ccc1162ebbe9663424f20f2ace97e2921f fbb4acce7d31b7351f3c4b42e6f718441d9408c4

View File

@ -141,10 +141,16 @@ namespace System.Security.Cryptography
static Utils() static Utils()
{ {
} }
#if MONO
// The default provider value must remain '1' for Mono, otherwise we won't be able
// to locate keypairs that were serialized by Mono versions 4.0 and lower.
// (The ProviderType property in the CspParameters class affects serialization)
internal const int DefaultRsaProviderType = 1;
#else
// Provider type to use by default for RSA operations. We want to use RSA-AES CSP // Provider type to use by default for RSA operations. We want to use RSA-AES CSP
// since it enables access to SHA-2 operations. All currently supported OSes support RSA-AES. // since it enables access to SHA-2 operations. All currently supported OSes support RSA-AES.
internal const int DefaultRsaProviderType = Constants.PROV_RSA_AES; internal const int DefaultRsaProviderType = Constants.PROV_RSA_AES;
#endif
#if !MONO #if !MONO
#if FEATURE_CRYPTO || FEATURE_LEGACYNETCFCRYPTO #if FEATURE_CRYPTO || FEATURE_LEGACYNETCFCRYPTO

View File

@ -424,6 +424,10 @@ namespace MonoTests.Mono.Unix {
foreach (Thread t in threads) foreach (Thread t in threads)
t.Join (); t.Join ();
AssertCountSet (usignals); AssertCountSet (usignals);
// signal delivery might take some time, wait a bit before closing
// the UnixSignal so we can ignore it and not terminate the process
// when a SIGHUP/SIGTERM arrives afterwards
Thread.Sleep (1000);
CloseSignals (usignals); CloseSignals (usignals);
} }

View File

@ -6,6 +6,9 @@ LIBRARY = System.Net.Http.dll
LIB_REFS = System.Core System LIB_REFS = System.Core System
LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS) LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
ifeq (monodroid,$(PROFILE))
LIB_MCS_FLAGS += -d:XAMARIN_MODERN
endif
TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll

View File

@ -0,0 +1,38 @@
using System;
using System.Reflection;
namespace System.Net.Http {
public partial class HttpClient {
public HttpClient ()
: this (GetDefaultHandler (), true)
{
}
static HttpMessageHandler GetDefaultHandler ()
{
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
if (type == null)
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
if (method == null)
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
object ret = method.Invoke (null, null);
if (ret == null)
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
var handler = ret as HttpMessageHandler;
if (handler == null)
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
return handler;
}
static HttpMessageHandler GetFallback (string message)
{
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
return new HttpClientHandler ();
}
}
}

View File

@ -0,0 +1,2 @@
#include System.Net.Http.dll.sources
System.Net.Http/HttpClient.android.cs

View File

@ -507,11 +507,15 @@ namespace System.Runtime.Serialization
} else { } else {
var typeHandleValue = Type.GetTypeHandle (memberValue); var typeHandleValue = Type.GetTypeHandle (memberValue);
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject)); var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
if (isNullableOfT) if (isNullableOfT) {
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle); ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
else } else if (memberType == Globals.TypeOfObject) {
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle); var dataContract = DataContract.GetDataContract (memberValue.GetType());
//InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), () => memberValue, memberType, writeXsiType); writer.WriteAttributeQualifiedName (Globals.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContract.Name, dataContract.Namespace);
ctx.InternalSerializeReference (writer, memberValue, false, false, -1, typeHandleValue);
} else {
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
}
} }
} }
} }

View File

@ -122,5 +122,17 @@ namespace MonoTests.System.Runtime.Serialization
Assert.IsTrue (s.Contains ("<Flags>All</Flags>")); Assert.IsTrue (s.Contains ("<Flags>All</Flags>"));
} }
} }
// Bug #37116
[Test]
public void KeyPairOfAny ()
{
var dict = new Dictionary<string, object> ();
dict.Add ("test", new List<string> () { "test entry" });
var dcs = new DataContractSerializer (typeof(Dictionary<string, object>));
dcs.WriteObject (new MemoryStream (), dict);
// Should not throw exception.
}
} }
} }

View File

@ -101,16 +101,17 @@ namespace System.Security.Cryptography.X509Certificates {
} }
} }
static IntPtr GetCertificate (X509Certificate certificate, out IntPtr dataPtr) static IntPtr GetCertificate (X509Certificate certificate)
{ {
var handle = certificate.Handle; var handle = certificate.Impl.GetNativeAppleCertificate ();
if (handle != IntPtr.Zero) { if (handle != IntPtr.Zero) {
dataPtr = IntPtr.Zero;
CFRetain (handle); CFRetain (handle);
return handle; return handle;
} }
dataPtr = MakeCFData (certificate.GetRawCertData ()); var dataPtr = MakeCFData (certificate.GetRawCertData ());
return SecCertificateCreateWithData (IntPtr.Zero, dataPtr); handle = SecCertificateCreateWithData (IntPtr.Zero, dataPtr);
CFRelease (dataPtr);
return handle;
} }
public static SecTrustResult TrustEvaluateSsl (XX509CertificateCollection certificates, XX509CertificateCollection anchors, string host) public static SecTrustResult TrustEvaluateSsl (XX509CertificateCollection certificates, XX509CertificateCollection anchors, string host)
@ -129,9 +130,7 @@ namespace System.Security.Cryptography.X509Certificates {
{ {
int certCount = certificates.Count; int certCount = certificates.Count;
int anchorCount = anchors != null ? anchors.Count : 0; int anchorCount = anchors != null ? anchors.Count : 0;
IntPtr [] cfDataPtrs = new IntPtr [certCount];
IntPtr [] secCerts = new IntPtr [certCount]; IntPtr [] secCerts = new IntPtr [certCount];
IntPtr [] cfDataAnchorPtrs = new IntPtr [anchorCount];
IntPtr [] secCertAnchors = new IntPtr [anchorCount]; IntPtr [] secCertAnchors = new IntPtr [anchorCount];
IntPtr certArray = IntPtr.Zero; IntPtr certArray = IntPtr.Zero;
IntPtr anchorArray = IntPtr.Zero; IntPtr anchorArray = IntPtr.Zero;
@ -142,13 +141,13 @@ namespace System.Security.Cryptography.X509Certificates {
try { try {
for (int i = 0; i < certCount; i++) { for (int i = 0; i < certCount; i++) {
secCerts [i] = GetCertificate (certificates [i], out cfDataPtrs [i]); secCerts [i] = GetCertificate (certificates [i]);
if (secCerts [i] == IntPtr.Zero) if (secCerts [i] == IntPtr.Zero)
return SecTrustResult.Deny; return SecTrustResult.Deny;
} }
for (int i = 0; i < anchorCount; i++) { for (int i = 0; i < anchorCount; i++) {
secCertAnchors [i] = GetCertificate (anchors [i], out cfDataAnchorPtrs [i]); secCertAnchors [i] = GetCertificate (anchors [i]);
if (secCertAnchors [i] == IntPtr.Zero) if (secCertAnchors [i] == IntPtr.Zero)
return SecTrustResult.Deny; return SecTrustResult.Deny;
} }
@ -170,14 +169,6 @@ namespace System.Security.Cryptography.X509Certificates {
code = SecTrustEvaluate (sectrust, out result); code = SecTrustEvaluate (sectrust, out result);
return result; return result;
} finally { } finally {
for (int i = 0; i < certCount; i++)
if (cfDataPtrs [i] != IntPtr.Zero)
CFRelease (cfDataPtrs [i]);
for (int i = 0; i < anchorCount; i++)
if (cfDataAnchorPtrs [i] != IntPtr.Zero)
CFRelease (cfDataAnchorPtrs [i]);
if (certArray != IntPtr.Zero) if (certArray != IntPtr.Zero)
CFRelease (certArray); CFRelease (certArray);

View File

@ -72,6 +72,11 @@ namespace System.Security.Cryptography.X509Certificates
get { return IntPtr.Zero; } get { return IntPtr.Zero; }
} }
public override IntPtr GetNativeAppleCertificate ()
{
return IntPtr.Zero;
}
internal X509Certificate2ImplMono (MX.X509Certificate cert) internal X509Certificate2ImplMono (MX.X509Certificate cert)
{ {
this._cert = cert; this._cert = cert;

View File

@ -37,6 +37,11 @@ namespace System.Security.Cryptography.X509Certificates
get; get;
} }
/*
* This is used in System.dll's OSX509Certificates.cs
*/
public abstract IntPtr GetNativeAppleCertificate ();
protected void ThrowIfContextInvalid () protected void ThrowIfContextInvalid ()
{ {
if (!IsValid) if (!IsValid)

View File

@ -34,7 +34,7 @@ using MX = Mono.Security.X509;
namespace System.Security.Cryptography.X509Certificates namespace System.Security.Cryptography.X509Certificates
{ {
class X509CertificateImplMono : X509CertificateImpl sealed class X509CertificateImplMono : X509CertificateImpl
{ {
MX.X509Certificate x509; MX.X509Certificate x509;
@ -51,6 +51,11 @@ namespace System.Security.Cryptography.X509Certificates
get { return IntPtr.Zero; } get { return IntPtr.Zero; }
} }
public override IntPtr GetNativeAppleCertificate ()
{
return IntPtr.Zero;
}
public override X509CertificateImpl Clone () public override X509CertificateImpl Clone ()
{ {
ThrowIfContextInvalid (); ThrowIfContextInvalid ();

View File

@ -39,7 +39,7 @@ namespace MonoTests.System.Security.Cryptography {
public void Ctor () public void Ctor ()
{ {
var cp = new CspParameters (); var cp = new CspParameters ();
Assert.AreEqual (24, cp.ProviderType); Assert.AreEqual (1, cp.ProviderType);
} }
} }
} }

View File

@ -1 +1 @@
8e64e5a6758d73dbf3d8c6fb3eb48c076357b70d d75327e36d7b32dc9109603a62412b3e8aa159fe

View File

@ -1 +1 @@
5de7e54e585f6b49306081a2d825a268eae55a8b d59fb29c1b13df4116b62d402850b1a5280b854b

View File

@ -1 +1 @@
7b90f739b90808c54955991f2ee7ade80d218166 dd524703971ceb5b9e38a37927cbf400b8445a80

View File

@ -1 +1 @@
bfba44fbb8c656079254fc346737ea8a4af5fd3e f649c2b1ac18409b8acd361e63e55ffa77ad5bd3

46
mcs/tests/dtest-064.cs Normal file
View File

@ -0,0 +1,46 @@
using System;
public class A
{
public A (Action action)
{
}
}
public class B : A
{
public B ()
: base (() => {
dynamic d = 1;
Test (d);
})
{
}
static decimal Test (dynamic arg)
{
return 3m;
}
}
public class B2
{
public Action a = () => {
dynamic d = 1;
Test (d);
};
static decimal Test (dynamic arg)
{
return 3m;
}
}
class M
{
static void Main ()
{
new B ();
new B2 ();
}
}

View File

@ -1 +1 @@
de9fea39fc570d60a08eeeba6e5eef06352b9197 d7429bd8b329499d480f33072157e4c6b7cde1d2

View File

@ -96,6 +96,12 @@ void
mono_mb_free (MonoMethodBuilder *mb) mono_mb_free (MonoMethodBuilder *mb)
{ {
#ifndef DISABLE_JIT #ifndef DISABLE_JIT
GList *l;
for (l = mb->locals_list; l; l = l->next) {
/* Allocated in mono_mb_add_local () */
g_free (l->data);
}
g_list_free (mb->locals_list); g_list_free (mb->locals_list);
if (!mb->dynamic) { if (!mb->dynamic) {
g_free (mb->method); g_free (mb->method);
@ -148,7 +154,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
header->code = mb->code; header->code = mb->code;
for (i = 0, l = mb->locals_list; l; l = l->next, i++) { for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data); header->locals [i] = (MonoType*)l->data;
} }
} else } else
#endif #endif
@ -172,11 +178,15 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
memcpy ((char*)header->code, mb->code, mb->pos); memcpy ((char*)header->code, mb->code, mb->pos);
for (i = 0, l = mb->locals_list; l; l = l->next, i++) { for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
header->locals [i] = mono_metadata_type_dup (NULL, (MonoType*)l->data); header->locals [i] = (MonoType*)l->data;
} }
#endif #endif
} }
/* Free the locals list so mono_mb_free () doesn't free the types twice */
g_list_free (mb->locals_list);
mb->locals_list = NULL;
method->signature = signature; method->signature = signature;
if (!signature->hasthis) if (!signature->hasthis)
method->flags |= METHOD_ATTRIBUTE_STATIC; method->flags |= METHOD_ATTRIBUTE_STATIC;
@ -268,12 +278,19 @@ int
mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type) mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type)
{ {
int res; int res;
MonoType *t;
/*
* Have to make a copy early since type might be sig->ret,
* which is transient, see mono_metadata_signature_dup_internal_with_padding ().
*/
t = mono_metadata_type_dup (NULL, type);
g_assert (mb != NULL); g_assert (mb != NULL);
g_assert (type != NULL); g_assert (type != NULL);
res = mb->locals; res = mb->locals;
mb->locals_list = g_list_append (mb->locals_list, type); mb->locals_list = g_list_append (mb->locals_list, t);
mb->locals++; mb->locals++;
return res; return res;

View File

@ -801,7 +801,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.4.0.122/a3fabf1\"" > version.h echo "#define FULL_VERSION \"Stable 4.4.0.142/81f38a9\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -801,7 +801,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.4.0.122/a3fabf1\"" > version.h echo "#define FULL_VERSION \"Stable 4.4.0.142/81f38a9\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -1 +1 @@
c30141f67c9a2e03366c40284ff6f85c7ec12f08 fe183791db460a9dd05074980db60cfb70ea20c4

View File

@ -248,7 +248,8 @@ mono_replace_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, MonoInst
bb->has_array_access |= first_bb->has_array_access; bb->has_array_access |= first_bb->has_array_access;
/* Delete the links between the original bb and its successors */ /* Delete the links between the original bb and its successors */
tmp_bblocks = bb->out_bb; tmp_bblocks = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoBasicBlock*) * bb->out_count);
memcpy (tmp_bblocks, bb->out_bb, sizeof (MonoBasicBlock*) * bb->out_count);
count = bb->out_count; count = bb->out_count;
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
mono_unlink_bblock (cfg, bb, tmp_bblocks [i]); mono_unlink_bblock (cfg, bb, tmp_bblocks [i]);

View File

@ -195,6 +195,7 @@ load_file (const char *name) {
if (is_template && !desc->name) if (is_template && !desc->name)
g_error ("Template without name at line %d in %s\n", line, name); g_error ("Template without name at line %d in %s\n", line, name);
} }
g_string_free (comment,TRUE);
fclose (f); fclose (f);
return 0; return 0;
} }

View File

@ -1163,7 +1163,7 @@ mini_jit_info_table_find_ext (MonoDomain *domain, char *addr, gboolean allow_tra
MonoJitInfo* MonoJitInfo*
mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domain) mini_jit_info_table_find (MonoDomain *domain, char *addr, MonoDomain **out_domain)
{ {
return mini_jit_info_table_find_ext (domain, addr, TRUE, out_domain); return mini_jit_info_table_find_ext (domain, addr, FALSE, out_domain);
} }
/* /*

View File

@ -1 +1 @@
#define FULL_VERSION "Stable 4.4.0.122/a3fabf1" #define FULL_VERSION "Stable 4.4.0.142/81f38a9"

View File

@ -89,7 +89,7 @@
/* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some
architectures is 64k. */ architectures is 64k. */
#if defined(TARGET_POWERPC64) #if defined(TARGET_POWERPC) || defined(TARGET_POWERPC64)
#define ARCH_MIN_MS_BLOCK_SIZE (64*1024) #define ARCH_MIN_MS_BLOCK_SIZE (64*1024)
#define ARCH_MIN_MS_BLOCK_SIZE_SHIFT 16 #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT 16
#endif #endif

View File

@ -614,7 +614,7 @@ null_link_if (gpointer hidden, GCHandleType handle_type, int max_generation, gpo
return hidden; return hidden;
if (closure->predicate (obj, closure->data)) if (closure->predicate (obj, closure->data))
return NULL; return MONO_GC_HANDLE_METADATA_POINTER (sgen_client_default_metadata (), GC_HANDLE_TYPE_IS_WEAK (handle_type));
return hidden; return hidden;
} }

Binary file not shown.

View File

@ -1 +1 @@
8b20cd235026fc1693543bc49585e0f3f6f4609c 4afeb56d03f2ff0ee686d07c1095753b1b597b6a

Binary file not shown.

View File

@ -1 +1 @@
9fdcb2cb2e205a2aa410ded94a2f7c1d10aeaa57 3e9cb2919279391d05fc709a3a605e5b3345c4cd

Binary file not shown.

View File

@ -1 +1 @@
ed5117bf4b8ffa445f8a891a2e99925990c94717 e805c0c6637c940bbad481235085f5803f523af3

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mono 4.4.0\n" "Project-Id-Version: mono 4.4.0\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2016-04-12 12:26-0400\n" "POT-Creation-Date: 2016-04-28 08:23-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
657c1675c390dbc3387b5670d3c9b168b2941302 b570606f4dc4d196eaca6f4988a275ebafa669fe