Author: jbevain
Date: 2005-02-26 17:09:48 -0500 (Sat, 26 Feb 2005)
New Revision: 41246
Modified:
trunk/cecil/lib/Mono.Cecil.Implem/CodeReader.cs
trunk/cecil/lib/Mono.Cecil.Implem/ReflectionReader.cs
Log:
support nested type refs
Modified: trunk/cecil/lib/Mono.Cecil.Implem/CodeReader.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Implem/CodeReader.cs 2005-02-26 21:26:18 UTC
(rev 41245)
+++ trunk/cecil/lib/Mono.Cecil.Implem/CodeReader.cs 2005-02-26 22:09:48 UTC
(rev 41246)
@@ -160,7 +160,7 @@
else if (IsToken (token, TokenType.TypeRef))
instr.Operand = m_reflectReader.GetTypeRefAt (GetRid
(token));
else if (IsToken (token, TokenType.TypeSpec))
- instr.Operand = m_reflectReader.GetTypeSpecAt (GetRid
(token));
+ instr.Operand = m_reflectReader.GetTypeSpecAt (GetRid
(token));
else if (IsToken (token, TokenType.Field))
instr.Operand = m_reflectReader.GetFieldDefAt (GetRid
(token));
else if (IsToken (token, TokenType.Method))
Modified: trunk/cecil/lib/Mono.Cecil.Implem/ReflectionReader.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Implem/ReflectionReader.cs 2005-02-26
21:26:18 UTC (rev 41245)
+++ trunk/cecil/lib/Mono.Cecil.Implem/ReflectionReader.cs 2005-02-26
22:09:48 UTC (rev 41246)
@@ -199,6 +199,17 @@
m_typeRefs [i] = t;
(m_module.TypeReferences as TypeReferenceCollection)
[t.FullName] = t;
}
+
+ // nested type ref
+
+ for (int i = 0; i < typesRef.Rows.Count; i++) {
+ TypeRefRow type = typesRef [i];
+ if (type.ResolutionScope.TokenType != TokenType.TypeRef)
+ continue;
+
+ TypeReference child = m_typeRefs [i];
+ child.DeclaringType = GetTypeRefAt ((int)
type.ResolutionScope.RID);
+ }
} else
m_typeRefs = new TypeReference [0];
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches