You've already forked linux-packaging-mono
Imported Upstream version 5.20.0.180
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
parent
0e2d47d1c8
commit
0510252385
9
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
9
external/cecil/Mono.Cecil/AssemblyReader.cs
vendored
@@ -2406,6 +2406,9 @@ namespace Mono.Cecil {
|
||||
if (token.TokenType != TokenType.Signature)
|
||||
throw new NotSupportedException ();
|
||||
|
||||
if (token.RID == 0)
|
||||
return null;
|
||||
|
||||
if (!MoveTo (Table.StandAloneSig, token.RID))
|
||||
return null;
|
||||
|
||||
@@ -3763,8 +3766,10 @@ namespace Mono.Cecil {
|
||||
if (length == 0)
|
||||
return string.Empty;
|
||||
|
||||
var @string = Encoding.UTF8.GetString (buffer, position,
|
||||
buffer [position + length - 1] == 0 ? length - 1 : length);
|
||||
if (position + length >= buffer.Length)
|
||||
return string.Empty;
|
||||
|
||||
var @string = Encoding.UTF8.GetString (buffer, position, length);
|
||||
|
||||
position += length;
|
||||
return @string;
|
||||
|
||||
39
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
39
external/cecil/Mono.Cecil/AssemblyWriter.cs
vendored
@@ -1445,8 +1445,7 @@ namespace Mono.Cecil {
|
||||
if (type.HasInterfaces)
|
||||
AddInterfaces (type);
|
||||
|
||||
if (type.HasLayoutInfo)
|
||||
AddLayoutInfo (type);
|
||||
AddLayoutInfo (type);
|
||||
|
||||
if (type.HasFields)
|
||||
AddFields (type);
|
||||
@@ -1557,12 +1556,36 @@ namespace Mono.Cecil {
|
||||
|
||||
void AddLayoutInfo (TypeDefinition type)
|
||||
{
|
||||
var table = GetTable<ClassLayoutTable> (Table.ClassLayout);
|
||||
if (type.HasLayoutInfo) {
|
||||
var table = GetTable<ClassLayoutTable> (Table.ClassLayout);
|
||||
|
||||
table.AddRow (new ClassLayoutRow (
|
||||
(ushort) type.PackingSize,
|
||||
(uint) type.ClassSize,
|
||||
type.token.RID));
|
||||
table.AddRow (new ClassLayoutRow (
|
||||
(ushort) type.PackingSize,
|
||||
(uint) type.ClassSize,
|
||||
type.token.RID));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (type.IsValueType && HasNoInstanceField (type)) {
|
||||
var table = GetTable<ClassLayoutTable> (Table.ClassLayout);
|
||||
|
||||
table.AddRow (new ClassLayoutRow (0, 1, type.token.RID));
|
||||
}
|
||||
}
|
||||
|
||||
static bool HasNoInstanceField (TypeDefinition type)
|
||||
{
|
||||
if (!type.HasFields)
|
||||
return true;
|
||||
|
||||
var fields = type.Fields;
|
||||
|
||||
for (int i = 0; i < fields.Count; i++)
|
||||
if (!fields [i].IsStatic)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddNestedTypes (TypeDefinition type)
|
||||
@@ -3162,7 +3185,7 @@ namespace Mono.Cecil {
|
||||
|
||||
void WriteTypeReference (TypeReference type)
|
||||
{
|
||||
WriteUTF8String (TypeParser.ToParseable (type));
|
||||
WriteUTF8String (TypeParser.ToParseable (type, top_level: false));
|
||||
}
|
||||
|
||||
public void WriteMarshalInfo (MarshalInfo marshal_info)
|
||||
|
||||
@@ -59,6 +59,15 @@ namespace Mono.Cecil {
|
||||
this.member = member;
|
||||
}
|
||||
|
||||
public ResolutionException (MemberReference member, Exception innerException)
|
||||
: base ("Failed to resolve " + member.FullName, innerException)
|
||||
{
|
||||
if (member == null)
|
||||
throw new ArgumentNullException ("member");
|
||||
|
||||
this.member = member;
|
||||
}
|
||||
|
||||
#if !NET_CORE
|
||||
ResolutionException (
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
|
||||
4
external/cecil/Mono.Cecil/TypeParser.cs
vendored
4
external/cecil/Mono.Cecil/TypeParser.cs
vendored
@@ -402,13 +402,13 @@ namespace Mono.Cecil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string ToParseable (TypeReference type)
|
||||
public static string ToParseable (TypeReference type, bool top_level = true)
|
||||
{
|
||||
if (type == null)
|
||||
return null;
|
||||
|
||||
var name = new StringBuilder ();
|
||||
AppendType (type, name, true, true);
|
||||
AppendType (type, name, true, top_level);
|
||||
return name.ToString ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user