From eed32f8c164a092ff5114b95dda4e75322a41623 Mon Sep 17 00:00:00 2001 From: marcos henrich Date: Sun, 4 Aug 2013 00:20:51 +0100 Subject: [PATCH] ImportScope now checks before returning new scope that the old scope is not the same as the Import.module. If it is the same it returns the Import.module so a self reference can be avoided. --- Mono.Cecil/Import.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Mono.Cecil/Import.cs b/Mono.Cecil/Import.cs index a32eb3c24..1472addc5 100644 --- a/Mono.Cecil/Import.cs +++ b/Mono.Cecil/Import.cs @@ -466,6 +466,7 @@ IMetadataScope ImportScope (IMetadataScope scope) case MetadataScopeType.AssemblyNameReference: return ImportAssemblyName ((AssemblyNameReference) scope); case MetadataScopeType.ModuleDefinition: + if (scope == module) return scope; return ImportAssemblyName (((ModuleDefinition) scope).Assembly.Name); case MetadataScopeType.ModuleReference: throw new NotImplementedException ();