diff options
author | jbevain <jbevain@gmail.com> | 2011-05-02 19:18:16 +0400 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2011-05-02 19:18:16 +0400 |
commit | cea8c10c2efec8197ccb29d21c0e408eebe07ebb (patch) | |
tree | 60ff05403d24c7a9770228233e2cc55055a6aaa5 /Mono.Cecil | |
parent | 4bc52d2976f7060dc65fb4075f301e4f9daaeb93 (diff) |
Fix lazy loading of methods and fields for #- heap
Diffstat (limited to 'Mono.Cecil')
-rw-r--r-- | Mono.Cecil/AssemblyReader.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index 0bb2407..75c253d 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -703,9 +703,24 @@ namespace Mono.Cecil { types.Add (type); } + if (image.HasTable (Table.MethodPtr) || image.HasTable (Table.FieldRVA)) + CompleteTypes (); + return types; } + void CompleteTypes () + { + var types = metadata.Types; + + for (int i = 0; i < types.Length; i++) { + var type = types [i]; + + InitializeCollection (type.Fields); + InitializeCollection (type.Methods); + } + } + void InitializeTypeDefinitions () { if (metadata.Types != null) |