diff options
Diffstat (limited to 'src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs')
-rw-r--r-- | src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs b/src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs index 188780b87..8f9a1cd34 100644 --- a/src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs +++ b/src/Common/src/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs @@ -52,6 +52,7 @@ namespace Internal.TypeSystem } } + Debug.Assert(builder.ToGCMap().Size * type.Context.Target.PointerSize >= type.GCStaticFieldSize.AsInt); return builder.ToGCMap(); } @@ -60,11 +61,11 @@ namespace Internal.TypeSystem /// </summary> public static GCPointerMap FromThreadStaticLayout(DefType type) { - GCPointerMapBuilder builder = new GCPointerMapBuilder(type.ThreadStaticFieldSize.AsInt, type.Context.Target.PointerSize); + GCPointerMapBuilder builder = new GCPointerMapBuilder(type.ThreadGcStaticFieldSize.AsInt, type.Context.Target.PointerSize); foreach (FieldDesc field in type.GetFields()) { - if (!field.IsStatic || field.HasRva || field.IsLiteral || !field.IsThreadStatic) + if (!field.IsStatic || field.HasRva || field.IsLiteral || !field.IsThreadStatic || !field.HasGCStaticBase) continue; TypeDesc fieldType = field.FieldType; @@ -84,6 +85,7 @@ namespace Internal.TypeSystem } } + Debug.Assert(builder.ToGCMap().Size * type.Context.Target.PointerSize >= type.ThreadGcStaticFieldSize.AsInt); return builder.ToGCMap(); } |