diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index 57f3aec8b1ee..6008101b3c00 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -827,8 +827,12 @@ protected override TypeReference GetReturnType (MethodDefinition method) return method.ReturnType; } + TypeReference system_void; protected override TypeReference GetSystemVoidType () { + if (system_void != null) + return system_void; + // find corlib AssemblyDefinition corlib = null; AssemblyDefinition first = null; @@ -847,7 +851,7 @@ protected override TypeReference GetSystemVoidType () } foreach (var type in corlib.MainModule.Types) { if (type.Namespace == "System" && type.Name == "Void") - return type; + return system_void = type; } throw new Exception ("Couldn't find System.Void");