mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
751e0fa359 | ||
|
|
07e600d669 | ||
|
|
bcb86f00d6 | ||
|
|
72ebbaf68c | ||
|
|
71a247b91b | ||
|
|
594e8fd07c | ||
|
|
616caad4e2 | ||
|
|
e36b27c948 | ||
|
|
31a1ccaab9 | ||
|
|
08f9819131 | ||
|
|
2bb3416919 | ||
|
|
721a8021ef | ||
|
|
d2d6def464 | ||
|
|
46f86234a8 | ||
|
|
6d2840038b | ||
|
|
6a4a74c828 | ||
|
|
5ab4c0d099 | ||
|
|
2d1186bac2 | ||
|
|
30ce4c9549 | ||
|
|
5290633d55 | ||
|
|
9253c5aff0 | ||
|
|
a3082c6844 | ||
|
|
4e06778b2a | ||
|
|
1f1307e64a | ||
|
|
59c8e3d932 | ||
|
|
f1f9bc4dd0 | ||
|
|
e36169af68 | ||
|
|
dc9e75e0c6 | ||
|
|
4eac076f94 |
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, [4.0.3],
|
||||
AC_INIT(mono, [4.0.4],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
|
||||
+1
-1
@@ -44,6 +44,7 @@ mobile_common_dirs := \
|
||||
System.ComponentModel.DataAnnotations \
|
||||
System.ComponentModel.Composition.4.5 \
|
||||
System.Net \
|
||||
System.Net.Http \
|
||||
System.Windows \
|
||||
System.Xml.Serialization \
|
||||
Mono.CSharp \
|
||||
@@ -57,7 +58,6 @@ mobile_static_dirs := \
|
||||
mobile_dynamic_dirs := \
|
||||
$(mobile_common_dirs) \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
System.Net.Http
|
||||
|
||||
xammac_dirs := \
|
||||
$(mobile_dynamic_dirs)
|
||||
|
||||
@@ -92,14 +92,12 @@ namespace MonoTests.Mono.Data.Sqlite {
|
||||
Assert.AreEqual(dr["Company.Name"], "Test CO");
|
||||
i += 2;
|
||||
}
|
||||
Assert.IsTrue(dr.FieldCount>0);
|
||||
Assert.IsTrue(dr.FieldCount>0, i.ToString ());
|
||||
}
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8, 2))
|
||||
Assert.IsTrue (false, "Apple fixed bug 27864, this check can now be removed");
|
||||
}
|
||||
} catch (SqliteException ex) {
|
||||
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8, 2)) // Expected Exception on iOS 8.2+, if this does not happen anymore it means apple fixed it
|
||||
// Expected Exception from iOS 8.2 (broken) to 9.0 (fixed)
|
||||
if (BCL.Tests.TestRuntime.CheckSystemVersion (8,2) && !BCL.Tests.TestRuntime.CheckSystemVersion (9,0))
|
||||
Assert.That (ex.Message.Contains ("no such column: com.Name"));
|
||||
else
|
||||
throw new AssertionException ("Unexpected Sqlite Error", ex); // This should not happen
|
||||
|
||||
@@ -340,6 +340,8 @@ namespace System.Net.Http
|
||||
wrequest.ContentLength = content.Headers.ContentLength.Value;
|
||||
}
|
||||
|
||||
wrequest.ResendContentFactory = content.CopyTo;
|
||||
|
||||
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
|
||||
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
|
||||
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
|
||||
|
||||
@@ -81,6 +81,12 @@ namespace System.Net.Http
|
||||
}
|
||||
}
|
||||
|
||||
// Only used by HttpWebRequest internals which is not async friendly
|
||||
internal void CopyTo (Stream stream)
|
||||
{
|
||||
CopyToAsync (stream).Wait ();
|
||||
}
|
||||
|
||||
public Task CopyToAsync (Stream stream)
|
||||
{
|
||||
return CopyToAsync (stream, null);
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
../../build/common/Consts.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
System.Net.Http/ByteArrayContent.cs
|
||||
System.Net.Http/ClientCertificateOption.cs
|
||||
System.Net.Http/DelegatingHandler.cs
|
||||
System.Net.Http/FormUrlEncodedContent.cs
|
||||
System.Net.Http/HttpClient.cs
|
||||
System.Net.Http/HttpClientHandler.cs
|
||||
System.Net.Http/HttpCompletionOption.cs
|
||||
System.Net.Http/HttpContent.cs
|
||||
System.Net.Http/HttpMessageHandler.cs
|
||||
System.Net.Http/HttpMessageInvoker.cs
|
||||
System.Net.Http/HttpMethod.cs
|
||||
System.Net.Http/HttpRequestException.cs
|
||||
System.Net.Http/HttpRequestMessage.cs
|
||||
System.Net.Http/HttpResponseMessage.cs
|
||||
System.Net.Http/MessageProcessingHandler.cs
|
||||
System.Net.Http/MultipartContent.cs
|
||||
System.Net.Http/MultipartFormDataContent.cs
|
||||
System.Net.Http/StreamContent.cs
|
||||
System.Net.Http/StringContent.cs
|
||||
System.Net.Http.Headers/AuthenticationHeaderValue.cs
|
||||
System.Net.Http.Headers/CacheControlHeaderValue.cs
|
||||
System.Net.Http.Headers/CollectionExtensions.cs
|
||||
System.Net.Http.Headers/CollectionParser.cs
|
||||
System.Net.Http.Headers/ContentDispositionHeaderValue.cs
|
||||
System.Net.Http.Headers/ContentRangeHeaderValue.cs
|
||||
System.Net.Http.Headers/EntityTagHeaderValue.cs
|
||||
System.Net.Http.Headers/HashCodeCalculator.cs
|
||||
System.Net.Http.Headers/HeaderInfo.cs
|
||||
System.Net.Http.Headers/HttpContentHeaders.cs
|
||||
System.Net.Http.Headers/HttpHeaderKind.cs
|
||||
System.Net.Http.Headers/HttpHeaders.cs
|
||||
System.Net.Http.Headers/HttpHeaderValueCollection.cs
|
||||
System.Net.Http.Headers/HttpRequestHeaders.cs
|
||||
System.Net.Http.Headers/HttpResponseHeaders.cs
|
||||
System.Net.Http.Headers/Lexer.cs
|
||||
System.Net.Http.Headers/MediaTypeHeaderValue.cs
|
||||
System.Net.Http.Headers/MediaTypeWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/NameValueHeaderValue.cs
|
||||
System.Net.Http.Headers/NameValueWithParametersHeaderValue.cs
|
||||
System.Net.Http.Headers/Parser.cs
|
||||
System.Net.Http.Headers/ProductHeaderValue.cs
|
||||
System.Net.Http.Headers/ProductInfoHeaderValue.cs
|
||||
System.Net.Http.Headers/QualityValue.cs
|
||||
System.Net.Http.Headers/RangeConditionHeaderValue.cs
|
||||
System.Net.Http.Headers/RangeHeaderValue.cs
|
||||
System.Net.Http.Headers/RangeItemHeaderValue.cs
|
||||
System.Net.Http.Headers/RetryConditionHeaderValue.cs
|
||||
System.Net.Http.Headers/StringWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/TransferCodingHeaderValue.cs
|
||||
System.Net.Http.Headers/TransferCodingWithQualityHeaderValue.cs
|
||||
System.Net.Http.Headers/ViaHeaderValue.cs
|
||||
System.Net.Http.Headers/WarningHeaderValue.cs
|
||||
@@ -110,6 +110,9 @@ namespace System.Net
|
||||
AuthorizationState auth_state, proxy_auth_state;
|
||||
string host;
|
||||
|
||||
[NonSerialized]
|
||||
internal Action<Stream> ResendContentFactory;
|
||||
|
||||
// Constructors
|
||||
static HttpWebRequest ()
|
||||
{
|
||||
@@ -226,9 +229,15 @@ namespace System.Net
|
||||
|
||||
internal bool InternalAllowBuffering {
|
||||
get {
|
||||
return (allowBuffering && (method != "HEAD" && method != "GET" &&
|
||||
method != "MKCOL" && method != "CONNECT" &&
|
||||
method != "TRACE"));
|
||||
return allowBuffering && MethodWithBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
bool MethodWithBuffer {
|
||||
get {
|
||||
return method != "HEAD" && method != "GET" &&
|
||||
method != "MKCOL" && method != "CONNECT" &&
|
||||
method != "TRACE";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1306,8 +1315,7 @@ namespace System.Net
|
||||
bodyBuffer = null;
|
||||
writeStream.Close ();
|
||||
}
|
||||
} else if (method != "HEAD" && method != "GET" && method != "MKCOL" && method != "CONNECT" &&
|
||||
method != "TRACE") {
|
||||
} else if (MethodWithBuffer) {
|
||||
if (getResponseCalled && !writeStream.RequestWritten)
|
||||
return writeStream.WriteRequestAsync (result);
|
||||
}
|
||||
@@ -1606,12 +1614,28 @@ namespace System.Net
|
||||
(ProxyQuery && !proxy_auth_state.IsCompleted && code == HttpStatusCode.ProxyAuthenticationRequired)) {
|
||||
if (!usedPreAuth && CheckAuthorization (webResponse, code)) {
|
||||
// Keep the written body, so it can be rewritten in the retry
|
||||
if (InternalAllowBuffering) {
|
||||
if (writeStream.WriteBufferLength > 0) {
|
||||
bodyBuffer = writeStream.WriteBuffer;
|
||||
bodyBufferLength = writeStream.WriteBufferLength;
|
||||
if (MethodWithBuffer) {
|
||||
if (AllowWriteStreamBuffering) {
|
||||
if (writeStream.WriteBufferLength > 0) {
|
||||
bodyBuffer = writeStream.WriteBuffer;
|
||||
bodyBufferLength = writeStream.WriteBufferLength;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Buffering is not allowed but we have alternative way to get same content (we
|
||||
// need to resent it due to NTLM Authentication).
|
||||
//
|
||||
if (ResendContentFactory != null) {
|
||||
using (var ms = new MemoryStream ()) {
|
||||
ResendContentFactory (ms);
|
||||
bodyBuffer = ms.ToArray ();
|
||||
bodyBufferLength = bodyBuffer.Length;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} else if (method != "PUT" && method != "POST") {
|
||||
bodyBuffer = null;
|
||||
return true;
|
||||
|
||||
@@ -362,6 +362,41 @@ namespace MonoTests.System.IO.Compression
|
||||
backing.Close();
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void CheckBufferOverrun ()
|
||||
{
|
||||
byte[] data = new byte [20];
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
|
||||
compressing.Write (data, 0, data.Length + 1);
|
||||
compressing.Close ();
|
||||
backing.Close ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bug28777_EmptyFlush ()
|
||||
{
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
|
||||
compressing.Flush ();
|
||||
compressing.Close ();
|
||||
backing.Close ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bug28777_DoubleFlush ()
|
||||
{
|
||||
byte[] buffer = new byte [4096];
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
|
||||
compressing.Write (buffer, 0, buffer.Length);
|
||||
compressing.Flush ();
|
||||
compressing.Flush ();
|
||||
compressing.Close ();
|
||||
backing.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,16 @@ namespace Xamarin.ApiDiff {
|
||||
{
|
||||
}
|
||||
|
||||
string GetContainingType (XElement el)
|
||||
{
|
||||
return el.Ancestors ("class").First ().Attribute ("type").Value;
|
||||
}
|
||||
|
||||
bool IsInInterface (XElement el)
|
||||
{
|
||||
return GetContainingType (el) == "interface";
|
||||
}
|
||||
|
||||
public XElement Source { get; set; }
|
||||
|
||||
public virtual bool Find (XElement e)
|
||||
@@ -182,9 +192,10 @@ namespace Xamarin.ApiDiff {
|
||||
public virtual void BeforeAdding (IEnumerable<XElement> list)
|
||||
{
|
||||
first = true;
|
||||
Output.WriteLine ("<p>Added {0}:</p><pre>", list.Count () > 1 ? GroupName : ElementName);
|
||||
if (State.Colorize)
|
||||
Output.Write ("<font color='green'>");
|
||||
Output.WriteLine ("<p>Added {0}:</p>", list.Count () > 1 ? GroupName : ElementName);
|
||||
|
||||
bool isInterface = list.Count () > 0 && IsInInterface (list.First ());
|
||||
Output.WriteLine (State.Colorize ? string.Format ("<pre style='color: {0}'>", isInterface ? "red" : "green") : "<pre>");
|
||||
}
|
||||
|
||||
public override void Added (XElement target)
|
||||
@@ -546,7 +557,7 @@ namespace Xamarin.ApiDiff {
|
||||
change.Append ("[Obsolete (");
|
||||
if (tgtObsolete != string.Empty)
|
||||
change.Append ("\"").Append (tgtObsolete).Append ("\"");
|
||||
change.Append ("]\n");
|
||||
change.Append (")]\n");
|
||||
change.Append (GetDescription (target));
|
||||
if (State.Colorize)
|
||||
change.Append ("</font>");
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace CorCompare
|
||||
var typesCollection = ass.MainModule.Types;
|
||||
if (typesCollection == null || typesCollection.Count == 0)
|
||||
return;
|
||||
object [] typesArray = new object [typesCollection.Count];
|
||||
var typesArray = new TypeDefinition [typesCollection.Count];
|
||||
for (int i = 0; i < typesCollection.Count; i++) {
|
||||
typesArray [i] = typesCollection [i];
|
||||
}
|
||||
@@ -454,7 +454,7 @@ namespace CorCompare
|
||||
|
||||
MethodDefinition [] ctors = GetConstructors (type);
|
||||
if (ctors.Length > 0) {
|
||||
Array.Sort (ctors, MemberReferenceComparer.Default);
|
||||
Array.Sort (ctors, MethodDefinitionComparer.Default);
|
||||
members.Add (new ConstructorData (document, nclass, ctors));
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace CorCompare
|
||||
|
||||
MethodDefinition [] methods = GetMethods (type);
|
||||
if (methods.Length > 0) {
|
||||
Array.Sort (methods, MemberReferenceComparer.Default);
|
||||
Array.Sort (methods, MethodDefinitionComparer.Default);
|
||||
members.Add (new MethodData (document, nclass, methods));
|
||||
}
|
||||
}
|
||||
@@ -495,11 +495,13 @@ namespace CorCompare
|
||||
nested.RemoveAt (i);
|
||||
}
|
||||
|
||||
|
||||
if (nested.Count > 0) {
|
||||
var nestedArray = nested.ToArray ();
|
||||
Array.Sort (nestedArray, TypeReferenceComparer.Default);
|
||||
|
||||
XmlNode classes = document.CreateElement ("classes", null);
|
||||
nclass.AppendChild (classes);
|
||||
foreach (TypeDefinition t in nested) {
|
||||
foreach (TypeDefinition t in nestedArray) {
|
||||
TypeData td = new TypeData (document, classes, t);
|
||||
td.DoOutput ();
|
||||
}
|
||||
|
||||
@@ -346,9 +346,25 @@ namespace Mono.Linker.Steps {
|
||||
// even if we (just before saving) will resolve all type references (bug #26752)
|
||||
void MarkWithResolvedScope (TypeReference type)
|
||||
{
|
||||
// we cannot set the Scope of a TypeSpecification so there's no point in resolving it
|
||||
if ((type == null) || (type is TypeSpecification))
|
||||
if (type == null)
|
||||
return;
|
||||
|
||||
// a GenericInstanceType can could contains generic arguments with scope that
|
||||
// needs to be updated out of the PCL facade (bug #28823)
|
||||
var git = (type as GenericInstanceType);
|
||||
if ((git != null) && git.HasGenericArguments) {
|
||||
foreach (var ga in git.GenericArguments)
|
||||
MarkWithResolvedScope (ga);
|
||||
return;
|
||||
}
|
||||
// we cannot set the Scope of a TypeSpecification but it's element type can be set
|
||||
// e.g. System.String[] -> System.String
|
||||
var ts = (type as TypeSpecification);
|
||||
if (ts != null) {
|
||||
MarkWithResolvedScope (ts.GetElementType ());
|
||||
return;
|
||||
}
|
||||
|
||||
var td = type.Resolve ();
|
||||
if (td != null)
|
||||
type.Scope = td.Scope;
|
||||
|
||||
@@ -179,81 +179,118 @@ namespace Mono.Linker.Steps {
|
||||
if (!type.HasMethods)
|
||||
return null;
|
||||
|
||||
foreach (MethodDefinition candidate in type.Methods)
|
||||
if (MethodMatch (candidate, method))
|
||||
Dictionary<string,string> gp = null;
|
||||
foreach (MethodDefinition candidate in type.Methods) {
|
||||
if (MethodMatch (candidate, method, ref gp))
|
||||
return candidate;
|
||||
if (gp != null)
|
||||
gp.Clear ();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static bool MethodMatch (MethodDefinition candidate, MethodDefinition method)
|
||||
static bool MethodMatch (MethodDefinition candidate, MethodDefinition method, ref Dictionary<string,string> genericParameters)
|
||||
{
|
||||
if (!candidate.IsVirtual)
|
||||
return false;
|
||||
|
||||
if (candidate.HasParameters != method.HasParameters)
|
||||
return false;
|
||||
|
||||
if (candidate.Name != method.Name)
|
||||
return false;
|
||||
|
||||
if (!TypeMatch (candidate.ReturnType, method.ReturnType))
|
||||
if (candidate.HasGenericParameters != method.HasGenericParameters)
|
||||
return false;
|
||||
|
||||
if (candidate.Parameters.Count != method.Parameters.Count)
|
||||
// we need to track what the generic parameter represent - as we cannot allow it to
|
||||
// differ between the return type or any parameter
|
||||
if (!TypeMatch (candidate.ReturnType, method.ReturnType, ref genericParameters))
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < candidate.Parameters.Count; i++)
|
||||
if (!TypeMatch (candidate.Parameters [i].ParameterType, method.Parameters [i].ParameterType))
|
||||
if (!candidate.HasParameters)
|
||||
return true;
|
||||
|
||||
var cp = candidate.Parameters;
|
||||
var mp = method.Parameters;
|
||||
if (cp.Count != mp.Count)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < cp.Count; i++) {
|
||||
if (!TypeMatch (cp [i].ParameterType, mp [i].ParameterType, ref genericParameters))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool TypeMatch (IModifierType a, IModifierType b)
|
||||
static bool TypeMatch (IModifierType a, IModifierType b, ref Dictionary<string,string> gp)
|
||||
{
|
||||
if (!TypeMatch (a.ModifierType, b.ModifierType))
|
||||
if (!TypeMatch (a.ModifierType, b.ModifierType, ref gp))
|
||||
return false;
|
||||
|
||||
return TypeMatch (a.ElementType, b.ElementType);
|
||||
return TypeMatch (a.ElementType, b.ElementType, ref gp);
|
||||
}
|
||||
|
||||
static bool TypeMatch (TypeSpecification a, TypeSpecification b)
|
||||
static bool TypeMatch (TypeSpecification a, TypeSpecification b, ref Dictionary<string,string> gp)
|
||||
{
|
||||
if (a is GenericInstanceType)
|
||||
return TypeMatch ((GenericInstanceType) a, (GenericInstanceType) b);
|
||||
var gita = a as GenericInstanceType;
|
||||
if (gita != null)
|
||||
return TypeMatch (gita, (GenericInstanceType) b, ref gp);
|
||||
|
||||
if (a is IModifierType)
|
||||
return TypeMatch ((IModifierType) a, (IModifierType) b);
|
||||
var mta = a as IModifierType;
|
||||
if (mta != null)
|
||||
return TypeMatch (mta, (IModifierType) b, ref gp);
|
||||
|
||||
return TypeMatch (a.ElementType, b.ElementType);
|
||||
return TypeMatch (a.ElementType, b.ElementType, ref gp);
|
||||
}
|
||||
|
||||
static bool TypeMatch (GenericInstanceType a, GenericInstanceType b)
|
||||
static bool TypeMatch (GenericInstanceType a, GenericInstanceType b, ref Dictionary<string,string> gp)
|
||||
{
|
||||
if (!TypeMatch (a.ElementType, b.ElementType))
|
||||
if (!TypeMatch (a.ElementType, b.ElementType, ref gp))
|
||||
return false;
|
||||
|
||||
if (a.GenericArguments.Count != b.GenericArguments.Count)
|
||||
if (a.HasGenericArguments != b.HasGenericArguments)
|
||||
return false;
|
||||
|
||||
if (a.GenericArguments.Count == 0)
|
||||
if (!a.HasGenericArguments)
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < a.GenericArguments.Count; i++)
|
||||
if (!TypeMatch (a.GenericArguments [i], b.GenericArguments [i]))
|
||||
var gaa = a.GenericArguments;
|
||||
var gab = b.GenericArguments;
|
||||
if (gaa.Count != gab.Count)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < gaa.Count; i++) {
|
||||
if (!TypeMatch (gaa [i], gab [i], ref gp))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool TypeMatch (TypeReference a, TypeReference b)
|
||||
static bool TypeMatch (TypeReference a, TypeReference b, ref Dictionary<string,string> gp)
|
||||
{
|
||||
if (a is GenericParameter)
|
||||
return true;
|
||||
var gpa = a as GenericParameter;
|
||||
if (gpa != null) {
|
||||
if (gp == null)
|
||||
gp = new Dictionary<string, string> ();
|
||||
string match;
|
||||
if (!gp.TryGetValue (gpa.FullName, out match)) {
|
||||
// first use, we assume it will always be used this way
|
||||
gp.Add (gpa.FullName, b.ToString ());
|
||||
return true;
|
||||
}
|
||||
// re-use, it should match the previous usage
|
||||
return match == b.ToString ();
|
||||
}
|
||||
|
||||
if (a is TypeSpecification || b is TypeSpecification) {
|
||||
if (a.GetType () != b.GetType ())
|
||||
return false;
|
||||
|
||||
return TypeMatch ((TypeSpecification) a, (TypeSpecification) b);
|
||||
return TypeMatch ((TypeSpecification) a, (TypeSpecification) b, ref gp);
|
||||
}
|
||||
|
||||
return a.FullName == b.FullName;
|
||||
|
||||
+109
-106
@@ -11,130 +11,133 @@ using Mono.Options;
|
||||
namespace Mono.MdbRebase
|
||||
{
|
||||
|
||||
class Settings
|
||||
{
|
||||
public string OutputDirectory { get; set; }
|
||||
public string InputPattern { get; set; }
|
||||
public string OutputPattern { get; set; }
|
||||
public bool InputPatternIsRegex { get; set; }
|
||||
public bool FileNamesOnly { get; set; }
|
||||
public bool Verbose { get; set; }
|
||||
|
||||
Regex inputPatternRegex;
|
||||
|
||||
public bool Validate ()
|
||||
class Settings
|
||||
{
|
||||
return InputPattern != null && OutputPattern != null;
|
||||
public string OutputDirectory { get; set; }
|
||||
public string InputPattern { get; set; }
|
||||
public string OutputPattern { get; set; }
|
||||
public bool InputPatternIsRegex { get; set; }
|
||||
public bool FileNamesOnly { get; set; }
|
||||
public bool Verbose { get; set; }
|
||||
public bool Quiet { get; set; }
|
||||
|
||||
Regex inputPatternRegex;
|
||||
|
||||
public bool Validate ()
|
||||
{
|
||||
return InputPattern != null && OutputPattern != null;
|
||||
}
|
||||
|
||||
public string Replace (string input)
|
||||
{
|
||||
if (InputPatternIsRegex) {
|
||||
if (inputPatternRegex == null)
|
||||
inputPatternRegex = new Regex (InputPattern);
|
||||
return inputPatternRegex.Replace (input, OutputPattern);
|
||||
} else {
|
||||
if (input.StartsWith (InputPattern))
|
||||
return OutputPattern + input.Substring (InputPattern.Length);
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
public string Replace (string input)
|
||||
class MdbRebase
|
||||
{
|
||||
if (InputPatternIsRegex) {
|
||||
if (inputPatternRegex == null)
|
||||
inputPatternRegex = new Regex (InputPattern);
|
||||
return inputPatternRegex.Replace (input, OutputPattern);
|
||||
} else {
|
||||
if (input.StartsWith (InputPattern))
|
||||
return OutputPattern + input.Substring (InputPattern.Length);
|
||||
Settings settings;
|
||||
|
||||
public MdbRebase (Settings settings)
|
||||
{
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
}
|
||||
public void RewriteMdbFile (string inputFile)
|
||||
{
|
||||
if (!settings.Quiet)
|
||||
Console.WriteLine ("Processing {0}", inputFile);
|
||||
var input = MonoSymbolFile.ReadSymbolFile (inputFile);
|
||||
|
||||
class MdbRebase
|
||||
{
|
||||
Settings settings;
|
||||
var output = new MonoSymbolFile ();
|
||||
|
||||
public MdbRebase (Settings settings)
|
||||
{
|
||||
this.settings = settings;
|
||||
}
|
||||
foreach (var s in input.Sources) {
|
||||
var newFileName = settings.FileNamesOnly
|
||||
? Path.Combine (Path.GetDirectoryName (s.FileName), settings.Replace (Path.GetFileName (s.FileName)))
|
||||
: settings.Replace (s.FileName);
|
||||
|
||||
public void RewriteMdbFile (string inputFile)
|
||||
{
|
||||
Console.WriteLine ("Processing {0}", inputFile);
|
||||
var input = MonoSymbolFile.ReadSymbolFile (inputFile);
|
||||
if (settings.Verbose)
|
||||
Console.WriteLine ("{0} -> {1}", s.FileName, newFileName);
|
||||
|
||||
var output = new MonoSymbolFile ();
|
||||
s.FileName = newFileName;
|
||||
output.AddSource (s);
|
||||
}
|
||||
|
||||
foreach (var s in input.Sources) {
|
||||
var newFileName = settings.FileNamesOnly
|
||||
? Path.Combine (Path.GetDirectoryName (s.FileName), settings.Replace (Path.GetFileName (s.FileName)))
|
||||
: settings.Replace (s.FileName);
|
||||
|
||||
if (settings.Verbose)
|
||||
Console.WriteLine ("{0} -> {1}", s.FileName, newFileName);
|
||||
|
||||
s.FileName = newFileName;
|
||||
output.AddSource (s);
|
||||
}
|
||||
|
||||
foreach (var cu in input.CompileUnits) {
|
||||
cu.ReadAll ();
|
||||
output.AddCompileUnit (cu);
|
||||
}
|
||||
|
||||
foreach (var m in input.Methods) {
|
||||
m.ReadAll ();
|
||||
output.AddMethod (m);
|
||||
}
|
||||
|
||||
|
||||
var mdbName = new FileInfo (inputFile).Name;
|
||||
var tmpMdb = Path.Combine (Path.GetTempPath (), mdbName);
|
||||
var finalMdb = inputFile;
|
||||
if (settings.OutputDirectory != null)
|
||||
finalMdb = Path.Combine (settings.OutputDirectory, mdbName);
|
||||
|
||||
using (var stream = new FileStream (tmpMdb, FileMode.Create)) {
|
||||
output.CreateSymbolFile (input.Guid, stream);
|
||||
}
|
||||
input.Dispose ();
|
||||
|
||||
File.Delete (finalMdb);
|
||||
File.Move (tmpMdb, finalMdb);
|
||||
}
|
||||
}
|
||||
|
||||
class Driver {
|
||||
static void Usage (OptionSet options)
|
||||
{
|
||||
Console.WriteLine (@"Usage: mdbrebase [options] <ASSEMBLY_TO_FIX>");
|
||||
if (options != null) {
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("Available options:");
|
||||
options.WriteOptionDescriptions (Console.Out);
|
||||
}
|
||||
Console.WriteLine ();
|
||||
foreach (var cu in input.CompileUnits) {
|
||||
cu.ReadAll ();
|
||||
output.AddCompileUnit (cu);
|
||||
}
|
||||
|
||||
Environment.Exit (-1);
|
||||
foreach (var m in input.Methods) {
|
||||
m.ReadAll ();
|
||||
output.AddMethod (m);
|
||||
}
|
||||
|
||||
|
||||
var mdbName = new FileInfo (inputFile).Name;
|
||||
var tmpMdb = Path.GetTempFileName ();
|
||||
var finalMdb = inputFile;
|
||||
if (settings.OutputDirectory != null)
|
||||
finalMdb = Path.Combine (settings.OutputDirectory, mdbName);
|
||||
|
||||
using (var stream = new FileStream (tmpMdb, FileMode.Create)) {
|
||||
output.CreateSymbolFile (input.Guid, stream);
|
||||
}
|
||||
input.Dispose ();
|
||||
|
||||
File.Delete (finalMdb);
|
||||
File.Move (tmpMdb, finalMdb);
|
||||
}
|
||||
}
|
||||
|
||||
static int Main (string[] args) {
|
||||
var s = new Settings ();
|
||||
bool showHelp = false;
|
||||
class Driver {
|
||||
static void Usage (OptionSet options)
|
||||
{
|
||||
Console.WriteLine (@"Usage: mdbrebase [options] <ASSEMBLY_TO_FIX>");
|
||||
if (options != null) {
|
||||
Console.WriteLine ();
|
||||
Console.WriteLine ("Available options:");
|
||||
options.WriteOptionDescriptions (Console.Out);
|
||||
}
|
||||
Console.WriteLine ();
|
||||
|
||||
Environment.Exit (-1);
|
||||
}
|
||||
|
||||
var p = new OptionSet () {
|
||||
{ "d=|output=", "Output directory to the mdb file, replace existing one if ommited", v => s.OutputDirectory = v },
|
||||
{ "v|verbose", "Be verbose with output (show individual path rewrites)", v => s.Verbose = true },
|
||||
{ "f|filenames", "Only operate on file names, not full absolute paths", v => s.FileNamesOnly = true },
|
||||
{ "r|regex", "Input pattern is a regular expression", v => s.InputPatternIsRegex = true },
|
||||
{ "i=|input-pattern=", "Input pattern to replace (must not be a prefix to output-pattern)(required)", v => s.InputPattern = v },
|
||||
{ "o=|output-pattern=", "Output pattern to replace (required)", v => s.OutputPattern = v },
|
||||
{ "h|?|help", v => showHelp = true },
|
||||
};
|
||||
static int Main (string[] args) {
|
||||
var s = new Settings ();
|
||||
bool showHelp = false;
|
||||
|
||||
List <string> extra = p.Parse (args);
|
||||
var p = new OptionSet () {
|
||||
{ "d=|output=", "Output directory to the mdb file, replace existing one if ommited", v => s.OutputDirectory = v },
|
||||
{ "v|verbose", "Be verbose with output (show individual path rewrites)", v => s.Verbose = true },
|
||||
{ "f|filenames", "Only operate on file names, not full absolute paths", v => s.FileNamesOnly = true },
|
||||
{ "r|regex", "Input pattern is a regular expression", v => s.InputPatternIsRegex = true },
|
||||
{ "i=|input-pattern=", "Input pattern to replace (must not be a prefix to output-pattern)(required)", v => s.InputPattern = v },
|
||||
{ "o=|output-pattern=", "Output pattern to replace (required)", v => s.OutputPattern = v },
|
||||
{ "q|quiet", "Be quiet with output (not show anything but errors)", v => s.Quiet = true },
|
||||
{ "h|?|help", v => showHelp = true },
|
||||
};
|
||||
|
||||
if (showHelp || extra.Count < 1 || !s.Validate ())
|
||||
Usage (p);
|
||||
List <string> extra = p.Parse (args);
|
||||
|
||||
var m = new MdbRebase (s);
|
||||
foreach (var a in extra)
|
||||
m.RewriteMdbFile (a);
|
||||
return 0;
|
||||
if (showHelp || extra.Count < 1 || !s.Validate ())
|
||||
Usage (p);
|
||||
|
||||
var m = new MdbRebase (s);
|
||||
foreach (var a in extra)
|
||||
m.RewriteMdbFile (a);
|
||||
return 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2007,6 +2007,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
|
||||
mono_image_unlock (image);
|
||||
return image->files [fileidx - 1];
|
||||
}
|
||||
mono_image_unlock (image);
|
||||
|
||||
fname_id = mono_metadata_decode_row_col (t, fileidx - 1, MONO_FILE_NAME);
|
||||
fname = mono_metadata_string_heap (image, fname_id);
|
||||
@@ -2020,7 +2021,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
|
||||
if (image->files && image->files [fileidx - 1]) {
|
||||
MonoImage *old = res;
|
||||
res = image->files [fileidx - 1];
|
||||
mono_loader_unlock ();
|
||||
mono_image_unlock (image);
|
||||
mono_image_close (old);
|
||||
} else {
|
||||
int i;
|
||||
@@ -2034,7 +2035,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
|
||||
if (!image->files)
|
||||
image->files = g_new0 (MonoImage*, t->rows);
|
||||
image->files [fileidx - 1] = res;
|
||||
mono_loader_unlock ();
|
||||
mono_image_unlock (image);
|
||||
/* vtable fixup can't happen with the image lock held */
|
||||
#ifdef HOST_WIN32
|
||||
if (res->is_module_handle)
|
||||
|
||||
@@ -398,14 +398,20 @@ MonoSeqPointInfo*
|
||||
get_seq_points (MonoDomain *domain, MonoMethod *method)
|
||||
{
|
||||
MonoSeqPointInfo *seq_points;
|
||||
MonoMethod *declaring_generic_method = NULL, *shared_method = NULL;
|
||||
|
||||
if (method->is_inflated) {
|
||||
declaring_generic_method = mono_method_get_declaring_generic_method (method);
|
||||
shared_method = mini_get_shared_method (method);
|
||||
}
|
||||
|
||||
mono_domain_lock (domain);
|
||||
seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, method);
|
||||
if (!seq_points && method->is_inflated) {
|
||||
/* generic sharing + aot */
|
||||
seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, mono_method_get_declaring_generic_method (method));
|
||||
seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, declaring_generic_method);
|
||||
if (!seq_points)
|
||||
seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, mini_get_shared_method (method));
|
||||
seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, shared_method);
|
||||
}
|
||||
mono_domain_unlock (domain);
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle)
|
||||
result->gchandle = gchandle;
|
||||
result->compress = compress;
|
||||
result->buffer = g_new (guchar, BUFFER_SIZE);
|
||||
result->stream->next_out = result->buffer;
|
||||
result->stream->avail_out = BUFFER_SIZE;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -148,7 +150,7 @@ flush_internal (ZStream *stream, gboolean is_final)
|
||||
if (!stream->compress)
|
||||
return 0;
|
||||
|
||||
if (!is_final) {
|
||||
if (!is_final && stream->stream->avail_in != 0) {
|
||||
status = deflate (stream->stream, Z_PARTIAL_FLUSH);
|
||||
if (status != Z_OK && status != Z_STREAM_END)
|
||||
return status;
|
||||
|
||||
+1
-1
@@ -642,5 +642,5 @@
|
||||
/* #undef USE_MONO_MUTEX */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "4.0.3"
|
||||
#define VERSION "4.0.4"
|
||||
#endif
|
||||
Reference in new issue
Block a user