Skip to content

Commit e4e3178

Browse files
authored
Merge pull request #9 from js6pak/pointers-contains-refs
Fix IsReferenceOrContainsReferences for pointers
2 parents 34113a1 + 708f1bd commit e4e3178

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/MonoMod.Backports/System/Memory,is_fx,lt_core_2.1,lt_std_2.1/SpanHelpers.Portable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static IntPtr Add<T>(this IntPtr start, int index)
131131

132132
private static bool IsReferenceOrContainsReferencesCore(Type type)
133133
{
134-
if (type.GetTypeInfo().IsPrimitive) // This is hopefully the common case. All types that return true for this are value types w/out embedded references.
134+
if (type.GetTypeInfo().IsPrimitive || type.GetTypeInfo().IsPointer) // This is hopefully the common case. All types that return true for this are value types w/out embedded references.
135135
return false;
136136

137137
if (!type.GetTypeInfo().IsValueType)

0 commit comments

Comments
 (0)