diff options
author | jbevain <jbevain@gmail.com> | 2011-05-20 23:35:02 +0400 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2011-05-20 23:35:02 +0400 |
commit | 154357af16659bc52750b42b72ff1444c01973df (patch) | |
tree | 6d57c6cd63b464c98dafb507b4d37ce0aa2940e0 /Mono.Cecil | |
parent | 96e996076d2a97cc3565cb40048b576dc777591d (diff) |
Create a modulref for types scoped on a file
Diffstat (limited to 'Mono.Cecil')
-rw-r--r-- | Mono.Cecil/AssemblyReader.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index b53a810..fd62622 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -2574,10 +2574,8 @@ namespace Mono.Cecil { scope = metadata.AssemblyReferences [(int) token.RID - 1]; break; case TokenType.File: + InitializeModuleReferences (); scope = GetModuleReferenceFromFile (token); - if (scope == null) - throw new NotSupportedException (); - break; default: throw new NotSupportedException (); @@ -2606,6 +2604,11 @@ namespace Mono.Cecil { break; } + if (reference == null) { + reference = new ModuleReference (file_name); + modules.Add (reference); + } + return reference; } |