Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikdasm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2017-09-12 23:18:10 +0300
committerLudovic Henry <ludovic@xamarin.com>2017-09-12 23:18:10 +0300
commit465c0815558fd43c0110f8d00fc186ac0044ac6a (patch)
treefed66b31967adf1dd66f82029c3d5bad834f8c5d
parent3aef9cdd6013fc0620a1817f0b11d8fb90ed2e0f (diff)
Add support for types created from typespec tokens to WriteTypeDefOrRef (). Fixes #58632. (#4)
-rw-r--r--Disassembler.cs26
1 files changed, 8 insertions, 18 deletions
diff --git a/Disassembler.cs b/Disassembler.cs
index 79ae69d..b6f9940 100644
--- a/Disassembler.cs
+++ b/Disassembler.cs
@@ -2730,10 +2730,10 @@ namespace Ildasm
void WriteSignatureType(LineWriter lw, Type type, TypeLocation loc)
{
- WriteSignatureType(lw, type, loc, false);
+ WriteSignatureType(lw, type, loc, false, false);
}
- void WriteSignatureType(LineWriter lw, Type type, TypeLocation loc, bool skipGenArgs)
+ void WriteSignatureType(LineWriter lw, Type type, TypeLocation loc, bool skipGenArgs, bool skipClass)
{
if (type.__IsVector)
{
@@ -2778,7 +2778,7 @@ namespace Ildasm
}
else if (!type.__IsMissing && type.IsGenericType && !type.IsGenericTypeDefinition)
{
- WriteSignatureType(lw, type.GetGenericTypeDefinition(), loc, true);
+ WriteSignatureType(lw, type.GetGenericTypeDefinition(), loc, true, false);
lw.Write("<");
string sep = "";
Type[] args = type.GetGenericArguments();
@@ -2883,7 +2883,10 @@ namespace Ildasm
}
else
{
- lw.Write(type.IsValueType ? "valuetype " : "class ");
+ if (!type.__IsMissing && !skipClass)
+ {
+ lw.Write(type.IsValueType ? "valuetype " : "class ");
+ }
WriteModuleOrAssemblyRef(lw, type.Module);
WriteTypeName(lw, type);
if (!skipGenArgs && !type.__IsMissing && type.IsGenericTypeDefinition)
@@ -2988,20 +2991,7 @@ namespace Ildasm
void WriteTypeDefOrRef(LineWriter lw, Type type)
{
- if (type.IsGenericParameter)
- {
- lw.Write(type.DeclaringMethod == null ? "!" : "!!");
- lw.Write("{0}", QuoteIdentifier(type.Name));
- }
- else if (type.IsArray)
- {
- WriteSignatureType(lw, type, TypeLocation.General);
- }
- else
- {
- WriteModuleOrAssemblyRef(lw, type.Module);
- WriteTypeName(lw, type);
- }
+ WriteSignatureType(lw, type, TypeLocation.General, true, true);
}
static void WriteBytes(LineWriter lw, byte[] buf, bool data)