diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs b/src/coreclr/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs index 07489f82c976aa..715afb935de0ff 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/ExplicitLayoutValidator.cs @@ -53,7 +53,7 @@ public int CompareTo(FieldLayoutInterval other) // Represent field layout bits as as a series of intervals to prevent pathological bad behavior // involving excessively large explicit layout structures. - private readonly List _fieldLayout = new List(); + private readonly List _fieldLayout; private readonly MetadataType _typeBeingValidated; @@ -61,6 +61,7 @@ private ExplicitLayoutValidator(MetadataType type, int typeSizeInBytes) { _typeBeingValidated = type; _pointerSize = type.Context.Target.PointerSize; + _fieldLayout = new List(); } public static void Validate(MetadataType type, ComputedInstanceFieldLayout layout)