You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.459
Former-commit-id: 2a5b9df2014f72665850c7f885e7aed54704a53a
This commit is contained in:
parent
a355c1b831
commit
e5cd25ff4f
15
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
15
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
@@ -2558,6 +2558,17 @@ namespace Mono.Cecil {
|
||||
return (int) size;
|
||||
}
|
||||
|
||||
public IEnumerable<CustomAttribute> GetCustomAttributes ()
|
||||
{
|
||||
InitializeTypeDefinitions ();
|
||||
|
||||
var length = image.TableHeap [Table.CustomAttribute].Length;
|
||||
var custom_attributes = new Collection<CustomAttribute> ((int) length);
|
||||
ReadCustomAttributeRange (new Range (1, length), custom_attributes);
|
||||
|
||||
return custom_attributes;
|
||||
}
|
||||
|
||||
public byte [] ReadCustomAttributeBlob (uint signature)
|
||||
{
|
||||
return ReadBlob (signature);
|
||||
@@ -3739,7 +3750,9 @@ namespace Mono.Cecil {
|
||||
if (i > 0 && separator != 0)
|
||||
builder.Append (separator);
|
||||
|
||||
builder.Append (reader.ReadUTF8StringBlob (ReadCompressedUInt32 ()));
|
||||
uint part = ReadCompressedUInt32 ();
|
||||
if (part != 0)
|
||||
builder.Append (reader.ReadUTF8StringBlob (part));
|
||||
}
|
||||
|
||||
return builder.ToString ();
|
||||
|
||||
22
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
22
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
@@ -85,6 +85,9 @@ namespace Mono.Cecil {
|
||||
|
||||
module.MetadataSystem.Clear ();
|
||||
|
||||
if (module.symbol_reader != null)
|
||||
module.symbol_reader.Dispose ();
|
||||
|
||||
var name = module.assembly != null ? module.assembly.Name : null;
|
||||
var fq_name = stream.value.GetFileName ();
|
||||
var symbol_writer_provider = parameters.SymbolWriterProvider;
|
||||
@@ -105,9 +108,6 @@ namespace Mono.Cecil {
|
||||
|
||||
BuildMetadata (module, metadata);
|
||||
|
||||
if (module.symbol_reader != null)
|
||||
module.symbol_reader.Dispose ();
|
||||
|
||||
var writer = ImageWriter.CreateWriter (module, metadata, stream);
|
||||
|
||||
writer.WriteImage ();
|
||||
@@ -2257,7 +2257,7 @@ namespace Mono.Cecil {
|
||||
{
|
||||
var rid = local_scope_table.AddRow (new LocalScopeRow (
|
||||
method_info.Method.MetadataToken.RID,
|
||||
AddImportScope (scope.Import),
|
||||
scope.import != null ? AddImportScope (scope.import) : 0,
|
||||
local_variable_rid,
|
||||
local_constant_rid,
|
||||
(uint) scope.Start.Offset,
|
||||
@@ -2273,9 +2273,6 @@ namespace Mono.Cecil {
|
||||
if (scope.HasConstants)
|
||||
AddLocalConstants (scope);
|
||||
|
||||
if (scope.Import != null)
|
||||
AddImportScope (scope.Import);
|
||||
|
||||
for (int i = 0; i < scope.Scopes.Count; i++)
|
||||
AddLocalScope (method_info, scope.Scopes [i]);
|
||||
}
|
||||
@@ -2516,10 +2513,13 @@ namespace Mono.Cecil {
|
||||
}
|
||||
|
||||
signature.WriteByte ((byte) separator);
|
||||
|
||||
var parts = name.Split (new [] { separator }, StringSplitOptions.RemoveEmptyEntries);
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (parts [i]));
|
||||
var parts = name.Split (new [] { separator });
|
||||
for (int i = 0; i < parts.Length; i++) {
|
||||
if (parts [i] == String.Empty)
|
||||
signature.WriteCompressedUInt32 (0);
|
||||
else
|
||||
signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (parts [i]));
|
||||
}
|
||||
|
||||
return signature;
|
||||
}
|
||||
|
||||
3
external/cecil/Mono.Cecil/MethodReference.cs
vendored
3
external/cecil/Mono.Cecil/MethodReference.cs
vendored
@@ -122,6 +122,9 @@ namespace Mono.Cecil {
|
||||
if (this.ReturnType.ContainsGenericParameter || base.ContainsGenericParameter)
|
||||
return true;
|
||||
|
||||
if (!HasParameters)
|
||||
return false;
|
||||
|
||||
var parameters = this.Parameters;
|
||||
|
||||
for (int i = 0; i < parameters.Count; i++)
|
||||
|
||||
@@ -48,6 +48,11 @@ namespace Mono.Cecil {
|
||||
set { Parameter.Attributes = value; }
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get { return Parameter.Name; }
|
||||
set { Parameter.Name = value; }
|
||||
}
|
||||
|
||||
public bool HasCustomAttributes {
|
||||
get { return parameter != null && parameter.HasCustomAttributes; }
|
||||
}
|
||||
|
||||
@@ -661,6 +661,14 @@ namespace Mono.Cecil {
|
||||
return Read (this, (_, reader) => reader.GetMemberReferences ());
|
||||
}
|
||||
|
||||
public IEnumerable<CustomAttribute> GetCustomAttributes ()
|
||||
{
|
||||
if (!HasImage)
|
||||
return Empty<CustomAttribute>.Array;
|
||||
|
||||
return Read (this, (_, reader) => reader.GetCustomAttributes ());
|
||||
}
|
||||
|
||||
public TypeReference GetType (string fullName, bool runtimeName)
|
||||
{
|
||||
return runtimeName
|
||||
|
||||
Reference in New Issue
Block a user