Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kyte <alexmkyte@gmail.com>2017-04-12 19:25:18 +0300
committerAlexis Christoforides <alexis@thenull.net>2017-05-16 14:45:36 +0300
commit00b5a7f9ff05143e87f2e23a66c6c0caceed90e1 (patch)
tree5eb078ef6e45c09356aefee04d7a4a2d4353ad5d /mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
parent5a82180366066abaeeb5af09db28dcfca0798033 (diff)
[runtime] Handle circular references in SRE types
We previously recursed through the entire directed cyclic graph of the type passed to SRE. When given a (legal) circular type reference, we encountered stack overflows. This was particularly easy to trigger with fsharpi and with FAKE. By creating everything about the type before searching for the parent, and by defering all type hierarchy establishment until the type must be surfaced to manage code, we tease out the data dependencies caught up in the cycle. Note the bounded lifetime of the unmanaged object hidden in the SRE module, which acts as a global reference for all types reachable from the TypeBuilder passed to the runtime through the icall.
Diffstat (limited to 'mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs1
1 files changed, 1 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
index 30ae09cdf16..b1cc9727d5a 100644
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
@@ -79,6 +79,7 @@ namespace System.Reflection.Emit
private GenericTypeParameterBuilder[] generic_params;
private RefEmitPermissionSet[] permissions;
private TypeInfo created;
+ private int state;
#endregion
#pragma warning restore 169