mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45d0ba1bc0 | ||
|
|
69104ca6c7 | ||
|
|
62a857ec77 | ||
|
|
2e5f57cc6c | ||
|
|
992e9ff54b | ||
|
|
1a2c7216c1 | ||
|
|
7348882b0b | ||
|
|
9ffca33e57 | ||
|
|
3b5a8e7214 | ||
|
|
44ae3e4969 |
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, [3.6.1],
|
||||
AC_INIT(mono, [3.8.0],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
|
||||
@@ -211,6 +211,10 @@ namespace System.Net.Http.Headers
|
||||
|
||||
static string EncodeBase64Value (string value)
|
||||
{
|
||||
bool quoted = value.Length > 1 && value [0] == '"' && value [value.Length - 1] == '"';
|
||||
if (quoted)
|
||||
value = value.Substring (1, value.Length - 2);
|
||||
|
||||
for (int i = 0; i < value.Length; ++i) {
|
||||
var ch = value[i];
|
||||
if (ch > 127) {
|
||||
@@ -220,7 +224,7 @@ namespace System.Net.Http.Headers
|
||||
}
|
||||
}
|
||||
|
||||
if (!Lexer.IsValidToken (value))
|
||||
if (quoted || !Lexer.IsValidToken (value))
|
||||
return "\"" + value + "\"";
|
||||
|
||||
return value;
|
||||
|
||||
+8
@@ -215,6 +215,14 @@ namespace MonoTests.System.Net.Http.Headers
|
||||
value.FileName = "(@)";
|
||||
Assert.AreEqual ("\"(@)\"", value.FileName, "#21");
|
||||
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"(@)\""), value.Parameters.First (), "#22");
|
||||
|
||||
value.FileName = "\"č\"";
|
||||
Assert.AreEqual ("č", value.FileName, "#31");
|
||||
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#32");
|
||||
|
||||
value.FileName = "\"quoted\"";
|
||||
Assert.AreEqual ("\"quoted\"", value.FileName, "#41");
|
||||
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"quoted\""), value.Parameters.First (), "#42");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace MonoTests.System.Net
|
||||
[TestFixture]
|
||||
public class DnsTest
|
||||
{
|
||||
private String site1Name = "mono-project.com",
|
||||
site1Dot = "96.126.105.110",
|
||||
private String site1Name = "xamarin.com",
|
||||
site1Dot = "50.19.126.231",
|
||||
site2Name = "info.diku.dk",
|
||||
site2Dot = "130.225.96.4",
|
||||
noneExistingSite = "unlikely.xamarin.com";
|
||||
@@ -44,7 +44,7 @@ namespace MonoTests.System.Net
|
||||
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
|
||||
IPHostEntry entry = Dns.EndGetHostByName (async);
|
||||
SubTestValidIPHostEntry (entry);
|
||||
Assert.IsTrue (entry.HostName == "www.mono-project.com" || entry.HostName == "mono-project.com");
|
||||
Assert.IsTrue (entry.HostName == "www.xamarin.com" || entry.HostName == "xamarin.com");
|
||||
}
|
||||
|
||||
void GetHostByNameCallback (IAsyncResult ar)
|
||||
@@ -191,7 +191,7 @@ namespace MonoTests.System.Net
|
||||
[Test]
|
||||
public void GetHostByName ()
|
||||
{
|
||||
SubTestGetHostByName ("www.mono-project.com", site1Dot);
|
||||
SubTestGetHostByName ("www.xamarin.com", site1Dot);
|
||||
SubTestGetHostByName (site2Name, site2Dot);
|
||||
try {
|
||||
var entry = Dns.GetHostByName (noneExistingSite);
|
||||
|
||||
@@ -1792,8 +1792,12 @@ namespace Mono.CSharp {
|
||||
// this argument is generated during compilation which speeds up dispatch
|
||||
// by about 25%
|
||||
//
|
||||
method_parameters = ParametersCompiled.Prefix (method_parameters,
|
||||
new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
|
||||
|
||||
//
|
||||
// Disabled for now due to JIT bug
|
||||
//
|
||||
//method_parameters = ParametersCompiled.Prefix (method_parameters,
|
||||
// new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
|
||||
}
|
||||
|
||||
if (storey == null && hoisted_tparams == null)
|
||||
|
||||
+4
-4
@@ -540,8 +540,8 @@ namespace Mono.CSharp
|
||||
// bool array can actually store any byte value
|
||||
//
|
||||
ig.Emit (OpCodes.Ldelem_U1);
|
||||
ig.Emit (OpCodes.Ldc_I4_1);
|
||||
ig.Emit (OpCodes.And);
|
||||
ig.Emit (OpCodes.Ldc_I4_0);
|
||||
ig.Emit (OpCodes.Cgt_Un);
|
||||
break;
|
||||
case BuiltinTypeSpec.Type.Byte:
|
||||
ig.Emit (OpCodes.Ldelem_U1);
|
||||
@@ -762,8 +762,8 @@ namespace Mono.CSharp
|
||||
break;
|
||||
case BuiltinTypeSpec.Type.Bool:
|
||||
ig.Emit (OpCodes.Ldind_I1);
|
||||
ig.Emit (OpCodes.Ldc_I4_1);
|
||||
ig.Emit (OpCodes.And);
|
||||
ig.Emit (OpCodes.Ldc_I4_0);
|
||||
ig.Emit (OpCodes.Cgt_Un);
|
||||
break;
|
||||
case BuiltinTypeSpec.Type.ULong:
|
||||
case BuiltinTypeSpec.Type.Long:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Compiler options: -unsafe
|
||||
|
||||
using System;
|
||||
|
||||
class BoolArrayWithByteValues
|
||||
@@ -18,6 +20,26 @@ class BoolArrayWithByteValues
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsafe bool Ptr ()
|
||||
{
|
||||
bool rv;
|
||||
|
||||
var arr = new byte [256];
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
arr [i] = (byte) i;
|
||||
fixed (byte* bptr = arr) {
|
||||
rv = true;
|
||||
for (int i = 0; i < arr.Length; i++) {
|
||||
bool* boptr = (bool*)(bptr + i);
|
||||
if (arr[i] > 0 && !*boptr)
|
||||
rv = false;
|
||||
System.Console.WriteLine ("#{0} = {1}", i, *boptr);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int Main()
|
||||
{
|
||||
var a = new bool[1];
|
||||
@@ -49,6 +71,9 @@ class BoolArrayWithByteValues
|
||||
if (res != 0)
|
||||
return res;
|
||||
|
||||
if (!Ptr ())
|
||||
return 6;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+739
-736
File diff suppressed because it is too large.
Load diff
@@ -40,6 +40,12 @@ class GFoo3<T> {
|
||||
// The tests use arrays to pass/receive values to keep the calling convention of the methods stable, which is a current limitation of the runtime support for gsharedvt.
|
||||
//
|
||||
|
||||
//
|
||||
// Interfaces are used to prevent the AOT compiler from discovering instantiations, thus forcing the usage of the gsharedvt
|
||||
// versions of methods. Unused vtype type arguments are used to test gsharedvt methods with ref type arguments, i.e.
|
||||
// when calling foo<T,T2> as foo<object,bool>, the gsharedvt version is used, but with a ref type argument.
|
||||
//
|
||||
|
||||
// FIXME: Add mixed ref/noref tests, i.e. Dictionary<string, int>
|
||||
|
||||
#if MOBILE
|
||||
@@ -221,6 +227,9 @@ public class Tests
|
||||
res = iface.Unbox<AnEnum, int> (AnEnum.One, 0, AnEnum.Two);
|
||||
if (res != AnEnum.Two)
|
||||
return 2;
|
||||
int res2 = iface.Unbox<int, AnEnum> (0, AnEnum.One, AnEnum.Two);
|
||||
if (res2 != 1)
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1019,6 +1028,7 @@ public class Tests
|
||||
return action(null, state);
|
||||
}
|
||||
|
||||
[Category ("!FULLAOT")]
|
||||
public static int test_0_delegate_wrappers () {
|
||||
Func<object, Pair<int, int>, Pair<int, int>> del1 = delegate (object o, Pair<int, int> p) { return p; };
|
||||
Func<object, Pair<int, int>, Pair<int, int>> del2 = delegate (object o, Pair<int, int> p) { return p; };
|
||||
@@ -1459,6 +1469,42 @@ public class Tests
|
||||
var c = new ReadOnlyCollection<AnEnum> (arr);
|
||||
return c.Contains (AnEnum.Two) == false ? 0 : 1;
|
||||
}
|
||||
|
||||
interface IFaceCallPatching {
|
||||
bool caller<T, T2> ();
|
||||
}
|
||||
|
||||
class CallPatching2<T> {
|
||||
T t;
|
||||
public object o;
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public bool callee () {
|
||||
return (string)o == "ABC";
|
||||
}
|
||||
}
|
||||
|
||||
class CallPatching : IFaceCallPatching {
|
||||
public bool caller<T, T2> () {
|
||||
var c = new CallPatching2<T> ();
|
||||
c.o = "ABC";
|
||||
return c.callee ();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// This tests that generic calls made from gsharedvt methods are not patched normally.
|
||||
// If they are, the first call to 'caller' would patch in the gshared version of
|
||||
// 'callee', causing the second call to fail because the gshared version of callee
|
||||
// wouldn't work with CallPatching2<bool> since it has a different object layout.
|
||||
//
|
||||
public static int test_0_call_patching () {
|
||||
IFaceCallPatching c = new CallPatching ();
|
||||
c.caller<object, bool> ();
|
||||
if (!c.caller<bool, bool> ())
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// #13191
|
||||
|
||||
@@ -1061,6 +1061,7 @@ MonoObject*
|
||||
mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
|
||||
{
|
||||
MonoJitTlsData *jit_tls = NULL;
|
||||
MonoClass *oklass;
|
||||
|
||||
if (mini_get_debug_options ()->better_cast_details) {
|
||||
jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
|
||||
@@ -1070,13 +1071,14 @@ mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
if (klass->enumtype && obj->vtable->klass == klass->element_class)
|
||||
oklass = obj->vtable->klass;
|
||||
if ((klass->enumtype && oklass == klass->element_class) || (oklass->enumtype && klass == oklass->element_class))
|
||||
return obj;
|
||||
if (mono_object_isinst (obj, klass))
|
||||
return obj;
|
||||
|
||||
if (mini_get_debug_options ()->better_cast_details) {
|
||||
jit_tls->class_cast_from = obj->vtable->klass;
|
||||
jit_tls->class_cast_from = oklass;
|
||||
jit_tls->class_cast_to = klass;
|
||||
}
|
||||
|
||||
|
||||
@@ -8390,8 +8390,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
|
||||
/*
|
||||
* Making generic calls out of gsharedvt methods.
|
||||
* This needs to be used for all generic calls, not just ones with a gsharedvt signature, to avoid
|
||||
* patching gshared method addresses into a gsharedvt method.
|
||||
*/
|
||||
if (cmethod && cfg->gsharedvt && mini_is_gsharedvt_signature (cfg, fsig)) {
|
||||
if (cmethod && cfg->gsharedvt && (mini_is_gsharedvt_signature (cfg, fsig) || cmethod->is_inflated || cmethod->klass->generic_class)) {
|
||||
MonoRgctxInfoType info_type;
|
||||
|
||||
if (virtual) {
|
||||
|
||||
@@ -408,11 +408,17 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
|
||||
struct task_basic_info t_info;
|
||||
mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
|
||||
|
||||
if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
|
||||
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
|
||||
if (pid == getpid ()) {
|
||||
/* task_for_pid () doesn't work on ios, even for the current process */
|
||||
task = mach_task_self ();
|
||||
} else {
|
||||
if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
|
||||
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
|
||||
mach_port_deallocate (mach_task_self (), task);
|
||||
if (pid != getpid ())
|
||||
mach_port_deallocate (mach_task_self (), task);
|
||||
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
|
||||
}
|
||||
|
||||
@@ -425,7 +431,8 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
mach_port_deallocate (mach_task_self (), task);
|
||||
if (pid != getpid ())
|
||||
mach_port_deallocate (mach_task_self (), task);
|
||||
|
||||
return ret;
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user