mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e66d9abbb2 | ||
|
|
1f4613aa1a | ||
|
|
d092ad186f | ||
|
|
c6605763a3 | ||
|
|
0fb4040ef1 | ||
|
|
fea2566b12 | ||
|
|
f3c9015ec4 | ||
|
|
0429840e5b | ||
|
|
28d71e9727 | ||
|
|
f1bca3dc5b | ||
|
|
fbc487ff42 | ||
|
|
72c4a0ca08 | ||
|
|
9685274a8a | ||
|
|
5cb0e59bea | ||
|
|
fc364332ff | ||
|
|
ff204dae30 | ||
|
|
9b466abc49 | ||
|
|
ab058f8e49 | ||
|
|
cb4c3ca997 | ||
|
|
0dd35e9d64 | ||
|
|
7ba4e9e7b1 | ||
|
|
71277e78f6 | ||
|
|
c61b3bd6d9 |
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [5.4.0],
|
||||
AC_INIT(mono, [5.4.1],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
|
||||
Vendored
+1
-1
Submodule external/bockbuild updated: 855e3737d8...0efdb371e6.
Vendored
+1
-1
Submodule external/corefx updated: 9ad53d674e...959fdbd00a.
@@ -149,7 +149,7 @@ namespace Mono.AppleTls
|
||||
}
|
||||
|
||||
var result = trust.Evaluate ();
|
||||
if (result == SecTrustResult.Unspecified)
|
||||
if (result == SecTrustResult.Unspecified || result == SecTrustResult.Proceed)
|
||||
return true;
|
||||
|
||||
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
|
||||
@@ -480,5 +480,136 @@ namespace MonoTests.System.Reflection.Emit
|
||||
Assert.AreEqual (0x02, il [14]); //typedef
|
||||
Assert.AreEqual (0x01, il [19]); //typeref
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodRefTokenSame () {
|
||||
// Get the same non-virtual method from a base and a derived type so
|
||||
// that the MemberInfo:DeclaredType differs but the tokens are the same.
|
||||
//
|
||||
// Regression test for bugzilla #59364
|
||||
|
||||
DefineBasicMethod ();
|
||||
|
||||
var m1 = typeof (object).GetMethod ("GetType");
|
||||
var m2 = typeof (string).GetMethod ("GetType");
|
||||
|
||||
var value_getter = typeof (RuntimeMethodHandle).GetProperty ("Value").GetMethod;
|
||||
|
||||
var il = il_gen;
|
||||
|
||||
var loc = il.DeclareLocal (typeof (RuntimeMethodHandle));
|
||||
|
||||
// return ((int)(RuntimeMethodHandle (m1).Value == RuntimeMethodHandle (m2).Value)).ToString ()
|
||||
il.Emit (OpCodes.Ldtoken, m1);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ldtoken, m2);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ceq);
|
||||
il.Emit (OpCodes.Box, typeof (Int32));
|
||||
il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
|
||||
il.Emit (OpCodes.Ret);
|
||||
|
||||
var baked = tb.CreateType ();
|
||||
|
||||
var x = Activator.CreateInstance (baked);
|
||||
var m = baked.GetMethod ("F");
|
||||
|
||||
var s = m.Invoke (x, null);
|
||||
|
||||
Assert.AreEqual ("1", s);
|
||||
|
||||
}
|
||||
|
||||
public class Base<T> {
|
||||
public int x;
|
||||
|
||||
public void M () { }
|
||||
}
|
||||
|
||||
public class Derived : Base<string> {
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FieldRefTokenSame () {
|
||||
DefineBasicMethod ();
|
||||
|
||||
// Get the same field from a base and a derived type so hat
|
||||
// the MemberInfo:DeclaredType differs but the tokens are the same.
|
||||
//
|
||||
// Regression test for bugzilla #59364
|
||||
|
||||
var f1 = typeof (Base<string>).GetField ("x");
|
||||
var f2 = typeof (Derived).GetField ("x");
|
||||
|
||||
var value_getter = typeof (RuntimeFieldHandle).GetProperty("Value").GetMethod;
|
||||
|
||||
var il = il_gen;
|
||||
|
||||
var loc = il.DeclareLocal (typeof (RuntimeFieldHandle));
|
||||
|
||||
il.Emit (OpCodes.Ldtoken, f1);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ldtoken, f2);
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloca, loc);
|
||||
il.Emit (OpCodes.Call, value_getter);
|
||||
il.Emit (OpCodes.Ceq);
|
||||
il.Emit (OpCodes.Box, typeof (Int32));
|
||||
il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
|
||||
il.Emit (OpCodes.Ret);
|
||||
|
||||
var baked = tb.CreateType ();
|
||||
|
||||
var x = Activator.CreateInstance (baked);
|
||||
var m = baked.GetMethod ("F");
|
||||
|
||||
var s = m.Invoke (x, null);
|
||||
|
||||
Assert.AreEqual ("1", s);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodSpecTokenSame () {
|
||||
DefineBasicMethod ();
|
||||
// Get the same method from a base generic instance and
|
||||
// a type derived from it so that the
|
||||
// MemberInfo:DeclaredType differs but the tokens are
|
||||
// the same.
|
||||
//
|
||||
// Regression test for bugzilla #60233
|
||||
|
||||
var m1 = typeof (Base<string>).GetMethod ("M");
|
||||
var m2 = typeof (Derived).GetMethod ("M");
|
||||
|
||||
var il = il_gen;
|
||||
|
||||
var loc = il.DeclareLocal (typeof (Derived));
|
||||
|
||||
il.Emit (OpCodes.Newobj, typeof (Derived).GetConstructor(new Type[]{}));
|
||||
il.Emit (OpCodes.Stloc, loc);
|
||||
il.Emit (OpCodes.Ldloc, loc);
|
||||
il.Emit (OpCodes.Call, m1);
|
||||
il.Emit (OpCodes.Ldloc, loc);
|
||||
il.Emit (OpCodes.Call, m2);
|
||||
il.Emit (OpCodes.Ldstr, "1");
|
||||
il.Emit (OpCodes.Ret);
|
||||
|
||||
var baked = tb.CreateType ();
|
||||
|
||||
var x = Activator.CreateInstance (baked);
|
||||
var m = baked.GetMethod ("F");
|
||||
|
||||
var s = m.Invoke (x, null);
|
||||
|
||||
Assert.AreEqual ("1", s);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -47,10 +47,11 @@ namespace System.Runtime.ExceptionServices {
|
||||
// Copy over the details we need to save.
|
||||
m_Exception = exception;
|
||||
#if MONO
|
||||
var count = exception.captured_traces == null ? 0 : exception.captured_traces.Length;
|
||||
var traces = exception.captured_traces;
|
||||
var count = traces == null ? 0 : traces.Length;
|
||||
var stack_traces = new System.Diagnostics.StackTrace [count + 1];
|
||||
if (count != 0)
|
||||
Array.Copy (exception.captured_traces, 0, stack_traces, 0, count);
|
||||
Array.Copy (traces, 0, stack_traces, 0, count);
|
||||
|
||||
stack_traces [count] = new System.Diagnostics.StackTrace (exception, 0, true);
|
||||
m_stackTrace = stack_traces;
|
||||
|
||||
@@ -204,9 +204,12 @@ mono_dynamic_image_register_token (MonoDynamicImage *assembly, guint32 token, Mo
|
||||
if (prev) {
|
||||
switch (how_collide) {
|
||||
case MONO_DYN_IMAGE_TOK_NEW:
|
||||
g_assert_not_reached ();
|
||||
g_warning ("%s: Unexpected previous object when called with MONO_DYN_IMAGE_TOK_NEW", __func__);
|
||||
break;
|
||||
case MONO_DYN_IMAGE_TOK_SAME_OK:
|
||||
g_assert (prev == MONO_HANDLE_RAW (obj));
|
||||
if (prev != MONO_HANDLE_RAW (obj)) {
|
||||
g_warning ("%s: condition `prev == MONO_HANDLE_RAW (obj)' not met", __func__);
|
||||
}
|
||||
break;
|
||||
case MONO_DYN_IMAGE_TOK_REPLACE:
|
||||
break;
|
||||
@@ -360,7 +363,6 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
|
||||
image->method_aux_hash = g_hash_table_new (NULL, NULL);
|
||||
image->vararg_aux_hash = g_hash_table_new (NULL, NULL);
|
||||
image->handleref = g_hash_table_new (NULL, NULL);
|
||||
image->handleref_managed = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module reference-to-token table");
|
||||
image->tokens = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module tokens table");
|
||||
image->generic_def_objects = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module generic definitions table");
|
||||
image->typespec = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
|
||||
@@ -480,7 +482,6 @@ void
|
||||
mono_dynamic_image_release_gc_roots (MonoDynamicImage *image)
|
||||
{
|
||||
release_hashtable (&image->token_fixups);
|
||||
release_hashtable (&image->handleref_managed);
|
||||
release_hashtable (&image->tokens);
|
||||
release_hashtable (&image->remapped_tokens);
|
||||
release_hashtable (&image->generic_def_objects);
|
||||
@@ -500,8 +501,6 @@ mono_dynamic_image_free (MonoDynamicImage *image)
|
||||
g_hash_table_destroy (di->typeref);
|
||||
if (di->handleref)
|
||||
g_hash_table_destroy (di->handleref);
|
||||
if (di->handleref_managed)
|
||||
mono_g_hash_table_destroy (di->handleref_managed);
|
||||
if (di->tokens)
|
||||
mono_g_hash_table_destroy (di->tokens);
|
||||
if (di->remapped_tokens)
|
||||
|
||||
@@ -498,7 +498,6 @@ struct _MonoDynamicImage {
|
||||
GHashTable *typespec;
|
||||
GHashTable *typeref;
|
||||
GHashTable *handleref;
|
||||
MonoGHashTable *handleref_managed;
|
||||
MonoGHashTable *tokens;
|
||||
GHashTable *blob_cache;
|
||||
GHashTable *standalonesig_cache;
|
||||
|
||||
+57
-16
@@ -740,7 +740,7 @@ is_field_on_inst (MonoClassField *field)
|
||||
|
||||
#ifndef DISABLE_REFLECTION_EMIT
|
||||
static guint32
|
||||
mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, MonoClassField *field)
|
||||
mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoClassField *field)
|
||||
{
|
||||
MonoType *type;
|
||||
guint32 token;
|
||||
@@ -748,7 +748,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
|
||||
g_assert (field);
|
||||
g_assert (field->parent);
|
||||
|
||||
token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, MONO_HANDLE_RAW (f)));
|
||||
token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, field));
|
||||
if (token)
|
||||
return token;
|
||||
|
||||
@@ -761,7 +761,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
|
||||
token = mono_image_get_memberref_token (assembly, &field->parent->byval_arg,
|
||||
mono_field_get_name (field),
|
||||
mono_dynimage_encode_fieldref_signature (assembly, field->parent->image, type));
|
||||
mono_g_hash_table_insert (assembly->handleref_managed, MONO_HANDLE_RAW (f), GUINT_TO_POINTER(token));
|
||||
g_hash_table_insert (assembly->handleref, field, GUINT_TO_POINTER(token));
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -1115,17 +1115,20 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
gboolean create_open_instance, gboolean register_token,
|
||||
MonoError *error)
|
||||
{
|
||||
HANDLE_FUNCTION_ENTER ();
|
||||
guint32 token = 0;
|
||||
|
||||
error_init (error);
|
||||
|
||||
MonoClass *klass = mono_handle_class (obj);
|
||||
MonoObjectHandle register_obj = MONO_HANDLE_NEW (MonoObject, NULL);
|
||||
MONO_HANDLE_ASSIGN (register_obj, obj);
|
||||
|
||||
/* Check for user defined reflection objects */
|
||||
/* TypeDelegator is the only corlib type which doesn't look like a MonoReflectionType */
|
||||
if (klass->image != mono_defaults.corlib || (strcmp (klass->name, "TypeDelegator") == 0)) {
|
||||
mono_error_set_not_supported (error, "User defined subclasses of System.Type are not yet supported");
|
||||
return 0;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
/* This function is called from ModuleBuilder:getToken multiple times for the same objects */
|
||||
@@ -1133,7 +1136,8 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
|
||||
if (strcmp (klass->name, "RuntimeType") == 0) {
|
||||
MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
|
||||
return_val_if_nok (error, 0);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MonoClass *mc = mono_class_from_mono_type (type);
|
||||
token = mono_metadata_token_from_dor (
|
||||
mono_dynimage_encode_typedef_or_ref_full (assembly, type, !mono_class_is_gtd (mc) || create_open_instance));
|
||||
@@ -1145,9 +1149,15 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
MonoReflectionMethodHandle m = MONO_HANDLE_CAST (MonoReflectionMethod, obj);
|
||||
MonoMethod *method = MONO_HANDLE_GETVAL (m, method);
|
||||
if (method->is_inflated) {
|
||||
if (create_open_instance)
|
||||
token = mono_image_get_methodspec_token (assembly, method);
|
||||
else
|
||||
if (create_open_instance) {
|
||||
guint32 methodspec_token = mono_image_get_methodspec_token (assembly, method);
|
||||
MonoReflectionMethodHandle canonical_obj =
|
||||
mono_method_get_object_handle (MONO_HANDLE_DOMAIN (obj), method, NULL, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
|
||||
token = methodspec_token;
|
||||
} else
|
||||
token = mono_image_get_inflated_method_token (assembly, method);
|
||||
} else if ((method->klass->image == &assembly->image) &&
|
||||
!mono_class_is_ginst (method->klass)) {
|
||||
@@ -1170,7 +1180,21 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
}
|
||||
} else {
|
||||
token = mono_image_get_methodref_token (assembly, method, create_open_instance);
|
||||
guint32 methodref_token = mono_image_get_methodref_token (assembly, method, create_open_instance);
|
||||
/* We need to register a 'canonical' object. The same
|
||||
* MonoMethod could have been reflected via different
|
||||
* classes so the MonoReflectionMethod:reftype could be
|
||||
* different, and the object lookup in
|
||||
* dynamic_image_register_token would assert assert. So
|
||||
* we pick the MonoReflectionMethod object that has the
|
||||
* reflected type as NULL (ie, take the declaring type
|
||||
* of the method) */
|
||||
MonoReflectionMethodHandle canonical_obj =
|
||||
mono_method_get_object_handle (MONO_HANDLE_DOMAIN (obj), method, NULL, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
|
||||
token = methodref_token;
|
||||
}
|
||||
/*g_print ("got token 0x%08x for %s\n", token, m->method->name);*/
|
||||
} else if (strcmp (klass->name, "MonoField") == 0) {
|
||||
@@ -1182,25 +1206,42 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
|
||||
token = MONO_TOKEN_FIELD_DEF | field_table_idx;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else {
|
||||
token = mono_image_get_fieldref_token (assembly, obj, field);
|
||||
guint32 fieldref_token = mono_image_get_fieldref_token (assembly, field);
|
||||
/* Same as methodref: get a canonical object to
|
||||
* register with the token. */
|
||||
MonoReflectionFieldHandle canonical_obj =
|
||||
mono_field_get_object_handle (MONO_HANDLE_DOMAIN (obj), field->parent, field, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
|
||||
token = fieldref_token;
|
||||
}
|
||||
/*g_print ("got token 0x%08x for %s\n", token, f->field->name);*/
|
||||
} else if (strcmp (klass->name, "MonoArrayMethod") == 0) {
|
||||
MonoReflectionArrayMethodHandle m = MONO_HANDLE_CAST (MonoReflectionArrayMethod, obj);
|
||||
token = mono_image_get_array_token (assembly, m, error);
|
||||
return_val_if_nok (error, 0);
|
||||
/* always returns a fresh token */
|
||||
guint32 array_token = mono_image_get_array_token (assembly, m, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
token = array_token;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else if (strcmp (klass->name, "SignatureHelper") == 0) {
|
||||
MonoReflectionSigHelperHandle s = MONO_HANDLE_CAST (MonoReflectionSigHelper, obj);
|
||||
token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
|
||||
return_val_if_nok (error, 0);
|
||||
/* always returns a fresh token */
|
||||
guint32 sig_token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
|
||||
if (!is_ok (error))
|
||||
goto leave;
|
||||
token = sig_token;
|
||||
how_collide = MONO_DYN_IMAGE_TOK_NEW;
|
||||
} else {
|
||||
g_error ("requested token for %s\n", klass->name);
|
||||
}
|
||||
|
||||
if (register_token)
|
||||
mono_dynamic_image_register_token (assembly, token, obj, how_collide);
|
||||
mono_dynamic_image_register_token (assembly, token, register_obj, how_collide);
|
||||
|
||||
return token;
|
||||
leave:
|
||||
HANDLE_FUNCTION_RETURN_VAL (token);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1297,8 +1297,13 @@ mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waital
|
||||
signalled = (waitall && count == nhandles) || (!waitall && count > 0);
|
||||
|
||||
if (signalled) {
|
||||
for (i = 0; i < nhandles; i++)
|
||||
own_if_signalled (handles [i], &abandoned [i]);
|
||||
for (i = 0; i < nhandles; i++) {
|
||||
if (own_if_signalled (handles [i], &abandoned [i]) && !waitall) {
|
||||
/* if we are calling WaitHandle.WaitAny, .NET only owns the first one; it matters for Mutex which
|
||||
* throw AbandonedMutexException in case we owned it but didn't release it */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mono_w32handle_unlock_handles (handles, nhandles);
|
||||
|
||||
@@ -2582,8 +2582,8 @@ ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64
|
||||
&start_ticks, &user_ticks, &kernel_ticks);
|
||||
|
||||
ticks_to_processtime (start_ticks, creation_processtime);
|
||||
ticks_to_processtime (user_ticks, kernel_processtime);
|
||||
ticks_to_processtime (kernel_ticks, user_processtime);
|
||||
ticks_to_processtime (kernel_ticks, kernel_processtime);
|
||||
ticks_to_processtime (user_ticks, user_processtime);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ aot_printerrf (MonoAotCompile *acfg, const gchar *format, ...)
|
||||
}
|
||||
|
||||
static void
|
||||
report_loader_error (MonoAotCompile *acfg, MonoError *error, const char *format, ...)
|
||||
report_loader_error (MonoAotCompile *acfg, MonoError *error, gboolean fatal, const char *format, ...)
|
||||
{
|
||||
FILE *output;
|
||||
va_list args;
|
||||
@@ -439,7 +439,7 @@ report_loader_error (MonoAotCompile *acfg, MonoError *error, const char *format,
|
||||
va_end (args);
|
||||
mono_error_cleanup (error);
|
||||
|
||||
if (acfg->is_full_aot) {
|
||||
if (acfg->is_full_aot && fatal) {
|
||||
fprintf (output, "FullAOT cannot continue if there are loader errors.\n");
|
||||
exit (1);
|
||||
}
|
||||
@@ -3832,7 +3832,7 @@ add_wrappers (MonoAotCompile *acfg)
|
||||
gboolean skip = FALSE;
|
||||
|
||||
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
|
||||
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
|
||||
if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
|
||||
(method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
|
||||
@@ -4181,7 +4181,7 @@ add_wrappers (MonoAotCompile *acfg)
|
||||
MonoError error;
|
||||
token = MONO_TOKEN_METHOD_DEF | (i + 1);
|
||||
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
|
||||
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
|
||||
if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
|
||||
if (method->is_generic) {
|
||||
@@ -4214,7 +4214,7 @@ add_wrappers (MonoAotCompile *acfg)
|
||||
guint32 token = MONO_TOKEN_METHOD_DEF | (i + 1);
|
||||
|
||||
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
|
||||
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
|
||||
if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
|
||||
(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
|
||||
@@ -4238,7 +4238,7 @@ add_wrappers (MonoAotCompile *acfg)
|
||||
int j;
|
||||
|
||||
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
|
||||
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
|
||||
/*
|
||||
* Only generate native-to-managed wrappers for methods which have an
|
||||
@@ -4248,7 +4248,7 @@ add_wrappers (MonoAotCompile *acfg)
|
||||
cattr = mono_custom_attrs_from_method_checked (method, &error);
|
||||
if (!is_ok (&error)) {
|
||||
char *name = mono_method_get_full_name (method);
|
||||
report_loader_error (acfg, &error, "Failed to load custom attributes from method %s due to %s\n", name, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load custom attributes from method %s due to %s\n", name, mono_error_get_message (&error));
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
@@ -7642,7 +7642,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
|
||||
if (cfg->exception_type != MONO_EXCEPTION_NONE) {
|
||||
/* Some instances cannot be JITted due to constraints etc. */
|
||||
if (!method->is_inflated)
|
||||
report_loader_error (acfg, &cfg->error, "Unable to compile method '%s' due to: '%s'.\n", mono_method_get_full_name (method), mono_error_get_message (&cfg->error));
|
||||
report_loader_error (acfg, &cfg->error, FALSE, "Unable to compile method '%s' due to: '%s'.\n", mono_method_get_full_name (method), mono_error_get_message (&cfg->error));
|
||||
/* Let the exception happen at runtime */
|
||||
return;
|
||||
}
|
||||
@@ -10271,7 +10271,7 @@ collect_methods (MonoAotCompile *acfg)
|
||||
continue;
|
||||
|
||||
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
|
||||
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
report_loader_error (acfg, &error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
|
||||
|
||||
if (method->is_generic || mono_class_is_gtd (method->klass)) {
|
||||
MonoMethod *gshared;
|
||||
|
||||
@@ -1996,6 +1996,23 @@ public class Tests
|
||||
Console.WriteLine ("X: " + iface.is_ref<AStruct3<string, int, int>> ());
|
||||
return 0;
|
||||
}
|
||||
|
||||
interface IFace59956 {
|
||||
int foo<T> ();
|
||||
}
|
||||
|
||||
class Impl59956 : IFace59956 {
|
||||
public int foo<T> () {
|
||||
var builder = new SparseArrayBuilder<T>(true);
|
||||
|
||||
return builder.Markers._count;
|
||||
}
|
||||
}
|
||||
|
||||
public static int test_1_59956_regress () {
|
||||
IFace59956 iface = new Impl59956 ();
|
||||
return iface.foo<int> ();
|
||||
}
|
||||
}
|
||||
|
||||
// #13191
|
||||
@@ -2013,6 +2030,35 @@ public class MobileServiceCollection<TTable, TCol>
|
||||
}
|
||||
}
|
||||
|
||||
// #59956
|
||||
internal struct Marker
|
||||
{
|
||||
public Marker(int count, int index) {
|
||||
}
|
||||
}
|
||||
|
||||
public struct ArrayBuilder<T>
|
||||
{
|
||||
private T[] _array;
|
||||
public int _count;
|
||||
|
||||
public ArrayBuilder(int capacity) {
|
||||
_array = new T[capacity];
|
||||
_count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct SparseArrayBuilder<T>
|
||||
{
|
||||
private ArrayBuilder<Marker> _markers;
|
||||
|
||||
public SparseArrayBuilder(bool initialize) : this () {
|
||||
_markers = new ArrayBuilder<Marker> (10);
|
||||
}
|
||||
|
||||
public ArrayBuilder<Marker> Markers => _markers;
|
||||
}
|
||||
|
||||
#if !__MOBILE__
|
||||
public class GSharedTests : Tests {
|
||||
}
|
||||
|
||||
@@ -2896,4 +2896,25 @@ END:
|
||||
IL_0018: ldloc.0
|
||||
ret
|
||||
}
|
||||
|
||||
.method public static bool llvm_regress_59436 () {
|
||||
// Code size 41 (0x29)
|
||||
.maxstack 3
|
||||
.locals init (float64 V_0,
|
||||
float64 V_1,
|
||||
valuetype [mscorlib]System.Decimal V_2)
|
||||
IL_0000: ldc.r8 1
|
||||
IL_0009: stloc.0
|
||||
IL_000a: ldc.r8 2
|
||||
IL_0013: stloc.1
|
||||
IL_0014: ldloc.0
|
||||
IL_0015: newobj instance void [mscorlib]System.Decimal::.ctor(float64)
|
||||
IL_001a: ldloca.s V_2
|
||||
IL_001c: ldloc.1
|
||||
IL_001d: call instance void [mscorlib]System.Decimal::.ctor(float64)
|
||||
IL_0022: ldloc.2
|
||||
IL_0023: call bool [mscorlib]System.Decimal::op_LessThanOrEqual(valuetype [mscorlib]System.Decimal,
|
||||
valuetype [mscorlib]System.Decimal)
|
||||
IL_0028: ret
|
||||
}
|
||||
}
|
||||
+22
-4
@@ -467,6 +467,9 @@ create_llvm_type_for_type (MonoLLVMModule *module, MonoClass *klass)
|
||||
static LLVMTypeRef
|
||||
type_to_llvm_type (EmitContext *ctx, MonoType *t)
|
||||
{
|
||||
if (t->byref)
|
||||
return ThisType ();
|
||||
|
||||
t = mini_get_underlying_type (t);
|
||||
|
||||
switch (t->type) {
|
||||
@@ -1226,10 +1229,10 @@ sig_to_llvm_sig_no_cinfo (EmitContext *ctx, MonoMethodSignature *sig)
|
||||
int i, pindex;
|
||||
MonoType *rtype;
|
||||
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
ret_type = type_to_llvm_type (ctx, rtype);
|
||||
ret_type = type_to_llvm_type (ctx, sig->ret);
|
||||
if (!ctx_ok (ctx))
|
||||
return NULL;
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
|
||||
param_types = g_new0 (LLVMTypeRef, (sig->param_count * 8) + 3);
|
||||
pindex = 0;
|
||||
@@ -1269,10 +1272,10 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
|
||||
if (!cinfo)
|
||||
return sig_to_llvm_sig_no_cinfo (ctx, sig);
|
||||
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
ret_type = type_to_llvm_type (ctx, rtype);
|
||||
ret_type = type_to_llvm_type (ctx, sig->ret);
|
||||
if (!ctx_ok (ctx))
|
||||
return NULL;
|
||||
rtype = mini_get_underlying_type (sig->ret);
|
||||
|
||||
switch (cinfo->ret.storage) {
|
||||
case LLVMArgVtypeInReg:
|
||||
@@ -7489,7 +7492,22 @@ mono_llvm_create_vars (MonoCompile *cfg)
|
||||
|
||||
sig = mono_method_signature (cfg->method);
|
||||
if (cfg->gsharedvt && cfg->llvm_only) {
|
||||
gboolean vretaddr = FALSE;
|
||||
|
||||
if (mini_is_gsharedvt_variable_signature (sig) && sig->ret->type != MONO_TYPE_VOID) {
|
||||
vretaddr = TRUE;
|
||||
} else {
|
||||
MonoMethodSignature *sig = mono_method_signature (cfg->method);
|
||||
LLVMCallInfo *linfo;
|
||||
|
||||
linfo = get_llvm_call_info (cfg, sig);
|
||||
vretaddr = (linfo->ret.storage == LLVMArgVtypeRetAddr || linfo->ret.storage == LLVMArgVtypeByRef || linfo->ret.storage == LLVMArgGsharedvtFixed || linfo->ret.storage == LLVMArgGsharedvtVariable || linfo->ret.storage == LLVMArgGsharedvtFixedVtype);
|
||||
}
|
||||
if (vretaddr) {
|
||||
/*
|
||||
* Creating vret_addr forces CEE_SETRET to store the result into it,
|
||||
* so we don't have to generate any code in our OP_SETRET case.
|
||||
*/
|
||||
cfg->vret_addr = mono_compile_create_var (cfg, &mono_get_intptr_class ()->byval_arg, OP_ARG);
|
||||
if (G_UNLIKELY (cfg->verbose_level > 1)) {
|
||||
printf ("vret_addr = ");
|
||||
|
||||
@@ -515,7 +515,8 @@ TESTS_CS_SRC= \
|
||||
runtime-invoke.gen.cs \
|
||||
imt_big_iface_test.cs \
|
||||
bug-58782-plain-throw.cs \
|
||||
bug-58782-capture-and-throw.cs
|
||||
bug-58782-capture-and-throw.cs \
|
||||
bug-59281.cs
|
||||
|
||||
if AMD64
|
||||
TESTS_CS_SRC += async-exc-compilation.cs finally_guard.cs finally_block_ending_in_dead_bb.cs
|
||||
@@ -840,7 +841,7 @@ PROFILE_DISABLED_TESTS += \
|
||||
constant-division.exe \
|
||||
dynamic-method-resurrection.exe \
|
||||
assembly_append_ordering.exe \
|
||||
assemblyresolve_event5.cs
|
||||
assemblyresolve_event5.exe
|
||||
|
||||
# Test which needs System.Web support
|
||||
PROFILE_DISABLED_TESTS += \
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
class Driver
|
||||
{
|
||||
|
||||
static readonly Mutex[] mutexes = new Mutex[2];
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
for (int i = 0; i < mutexes.Length; i++) {
|
||||
mutexes [i] = new Mutex();
|
||||
}
|
||||
|
||||
Thread thread1 = new Thread(() => {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
int idx = -1;
|
||||
try {
|
||||
idx = WaitHandle.WaitAny (mutexes);
|
||||
Console.WriteLine($"Thread 1 iter: {i} with mutex: {idx}");
|
||||
} finally {
|
||||
if (idx != -1)
|
||||
mutexes [idx].ReleaseMutex();
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Thread 1 ended");
|
||||
});
|
||||
|
||||
thread1.Start();
|
||||
thread1.Join();
|
||||
|
||||
Thread thread2 = new Thread(() => {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int idx = -1;
|
||||
try {
|
||||
idx = WaitHandle.WaitAny (mutexes);
|
||||
Console.WriteLine($"Thread 2 iter: {i} with mutex: {idx}");
|
||||
} finally {
|
||||
if (idx != -1)
|
||||
mutexes [idx].ReleaseMutex();
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Thread 2 ended");
|
||||
});
|
||||
|
||||
thread2.Start();
|
||||
thread2.Join();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -22,7 +22,7 @@ IF NOT %ERRORLEVEL% == 0 (
|
||||
ECHO copy %WIN_CONFIG_H% %CONFIG_H%
|
||||
copy %WIN_CONFIG_H% %CONFIG_H%
|
||||
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content %CONFIG_H%) -replace '#MONO_VERSION#', (Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content %CONFIG_H%" 2>&1
|
||||
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
|
||||
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],0,$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
|
||||
)
|
||||
|
||||
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1
|
||||
|
||||
@@ -100,7 +100,7 @@ class MonoReleaseProfile(DarwinProfile):
|
||||
self.env.set('PANGO_SYSCONFDIR', '%{staged_prefix}/etc')
|
||||
self.env.set('PANGO_LIBDIR', '%{staged_prefix}/lib')
|
||||
# self.env.set ('MONO_PATH', '%{staged_prefix}/lib/mono/4.0')
|
||||
self.debug_info = ['gtk+', 'cairo',
|
||||
self.debug_info = ['glib', 'gtk+', 'cairo',
|
||||
'pango', 'mono', 'llvm', 'libgdiplus']
|
||||
self.cache_host = None
|
||||
|
||||
@@ -396,4 +396,4 @@ class MonoReleaseProfile(DarwinProfile):
|
||||
|
||||
subprocess.call(['bash', '-c', path])
|
||||
|
||||
MonoReleaseProfile()
|
||||
MonoReleaseProfile()
|
||||
Reference in new issue
Block a user