diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2017-10-18 20:01:52 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2017-10-18 20:01:52 +0300 |
commit | 9d5d041c350139b3d2981b2a9ab669cb67c14e91 (patch) | |
tree | 6be389cd19d1e2e1ddb5c881e7da6d0a8c10fc24 /src/ILCompiler.Compiler | |
parent | b1f2d21fd0cfb9b779ecd715b64d62063f79b0cd (diff) |
ProjectX: Generic method on lazy generic type should also be lazy
Generic method on lazy generic type should also have a lazy generic dictionary otherwise generic lookups over the containing type's arguments may get expanded unlimitedly
[tfs-changeset: 1678427]
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/LazyGenericsPolicy.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/LazyGenericsPolicy.cs b/src/ILCompiler.Compiler/src/Compiler/LazyGenericsPolicy.cs index 738fd18e6..5890d260e 100644 --- a/src/ILCompiler.Compiler/src/Compiler/LazyGenericsPolicy.cs +++ b/src/ILCompiler.Compiler/src/Compiler/LazyGenericsPolicy.cs @@ -17,10 +17,13 @@ namespace ILCompiler { public sealed override bool UsesLazyGenerics(MethodDesc method) { + if (UsesLazyGenerics(method.OwningType)) + return true; + if (method.HasInstantiation) return method.IsVirtual || method.HasCustomAttribute("System.Runtime.CompilerServices", "ForceLazyDictionaryAttribute"); - else - return UsesLazyGenerics(method.OwningType); + + return false; } public sealed override bool UsesLazyGenerics(TypeDesc type) |