Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<FeaturePortableThreadPool Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableThreadPool>
<FeaturePortableTimer Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableTimer>
<FeatureSingleThread Condition="'$(TargetsBrowser)' == 'true'">true</FeatureSingleThread>
<EnableUnsafeAnalyzer>true</EnableUnsafeAnalyzer>
</PropertyGroup>

<ItemGroup>
Expand Down
42 changes: 35 additions & 7 deletions src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,11 @@ internal IEnumerator<T> GetEnumerator<T>()
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
int length = @this.Length;
return length == 0 ? SZGenericArrayEnumerator<T>.Empty : new SZGenericArrayEnumerator<T>(@this, length);
}
Expand All @@ -411,23 +415,35 @@ private void CopyTo<T>(T[] array, int index)
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!

T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
Array.Copy(@this, 0, array, index, @this.Length);
}

internal int get_Count<T>()
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
return @this.Length;
}

internal T get_Item<T>(int index)
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
if ((uint)index >= (uint)@this.Length)
{
ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessException();
Expand All @@ -440,7 +456,11 @@ internal void set_Item<T>(int index, T value)
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
if ((uint)index >= (uint)@this.Length)
{
ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessException();
Expand All @@ -459,7 +479,11 @@ private bool Contains<T>(T value)
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
return Array.IndexOf(@this, value, 0, @this.Length) >= 0;
}

Expand All @@ -480,7 +504,11 @@ private int IndexOf<T>(T value)
{
// ! Warning: "this" is an array, not an SZArrayHelper. See comments above
// ! or you may introduce a security hole!
T[] @this = Unsafe.As<T[]>(this);
T[] @this;
unsafe
{
@this = Unsafe.As<T[]>(this);
}
return Array.IndexOf(@this, value, 0, @this.Length);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ private bool BindToMethodInfo(object? target, IRuntimeMethodInfo method, Runtime
private static MulticastDelegate InternalAlloc(RuntimeType type)
{
Debug.Assert(type.IsAssignableTo(typeof(MulticastDelegate)));
return Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAlloc(type));
// FIXME: review unsafe to confirm correct annotation
unsafe
{
return Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAlloc(type));
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ public sealed override bool Equals([NotNullWhen(true)] object? obj)
// the types are the same, obj should also be a
// MulticastDelegate
Debug.Assert(obj is MulticastDelegate, "Shouldn't have failed here since we already checked the types are the same!");
MulticastDelegate d = Unsafe.As<MulticastDelegate>(obj);
MulticastDelegate d;
unsafe
{
d = Unsafe.As<MulticastDelegate>(obj);
}

if (_invocationCount != 0)
{
Expand Down Expand Up @@ -165,10 +169,14 @@ private static bool TrySetSlot(object?[] a, int index, object o)
return false;
}

private unsafe MulticastDelegate NewMulticastDelegate(object[] invocationList, int invocationCount, bool thisIsMultiCastAlready)
private MulticastDelegate NewMulticastDelegate(object[] invocationList, int invocationCount, bool thisIsMultiCastAlready)
{
// First, allocate a new multicast delegate just like this one, i.e. same type as the this object
MulticastDelegate result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks(RuntimeHelpers.GetMethodTable(this)));
MulticastDelegate result;
unsafe
{
result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks(RuntimeHelpers.GetMethodTable(this)));
}

// Performance optimization - if this already points to a true multicast delegate,
// copy _methodPtr and _methodPtrAux fields rather than calling into the EE to get them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,9 @@ private static bool FilterApplyMethodBase(
private readonly object m_keepalive; // This will be filled with a LoaderAllocator reference when this RuntimeType represents a collectible type
#pragma warning restore CS0169
#pragma warning restore CA1823
private IntPtr m_cache;
// Must be a handle to a RuntimeTypeCache type
[RequiresUnsafe]
private unsafe IntPtr m_cache;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add [RequiresUnsafe] as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Added [RequiresUnsafe] to m_cache field.

internal IntPtr m_handle;

internal static readonly RuntimeType ValueType = (RuntimeType)typeof(ValueType);
Expand Down Expand Up @@ -2448,7 +2450,10 @@ private RuntimeTypeCache? CacheIfExists
{
object? cache = GCHandle.InternalGet(m_cache);
Debug.Assert(cache == null || cache is RuntimeTypeCache);
return Unsafe.As<RuntimeTypeCache>(cache);
unsafe
{
return Unsafe.As<RuntimeTypeCache>(cache);
}
}
return null;
}
Expand All @@ -2465,7 +2470,10 @@ private RuntimeTypeCache Cache
if (cache != null)
{
Debug.Assert(cache is RuntimeTypeCache);
return Unsafe.As<RuntimeTypeCache>(cache);
unsafe
{
return Unsafe.As<RuntimeTypeCache>(cache);
}
}
}
return InitializeCache();
Expand Down
1 change: 1 addition & 0 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<Nullable Condition="'$(Nullable)' == '' and '$(IsTestProject)' == 'true'">annotations</Nullable>
<!-- AOT compatibility is enabled by default for src/ref projects. -->
<IsAotCompatible Condition="'$(IsAotCompatible)' == '' and ('$(IsSourceProject)' == 'true' or '$(IsReferenceAssemblyProject)' == 'true')">true</IsAotCompatible>
<EnableUnsafeAnalyzer>true</EnableUnsafeAnalyzer>
</PropertyGroup>

<!-- Set up common paths -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\RequiresAssemblyFilesAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\RequiresDynamicCodeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\RequiresUnsafeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\SetsRequiredMembersAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\StringSyntaxAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\CodeAnalysis\SuppressMessageAttribute.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
SharedArrayPoolThreadLocalArray[]? tlsBuckets = t_tlsBuckets;
if (tlsBuckets is not null && (uint)bucketIndex < (uint)tlsBuckets.Length)
{
buffer = Unsafe.As<T[]>(tlsBuckets[bucketIndex].Array);
unsafe
{
// Array should always be an array of T[]
buffer = Unsafe.As<T[]>(tlsBuckets[bucketIndex].Array);
}
if (buffer is not null)
{
tlsBuckets[bucketIndex].Array = null;
Expand All @@ -79,7 +83,10 @@
SharedArrayPoolPartitions? b = perCoreBuckets[bucketIndex];
if (b is not null)
{
buffer = Unsafe.As<T[]>(b.TryPop());
unsafe
{
buffer = Unsafe.As<T[]>(b.TryPop());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TryPop must always be a T[] so please make sure that any of the input methods to SharedArrayPoolPartitions are unsafe and have a comment about that requirement.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit c0df804. Made TryPush method unsafe with comment "Array parameter must be a T[]".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mark the TryPush method RequiresUnsafe instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Changed TryPush method from unsafe to [RequiresUnsafe].

}
if (buffer is not null)
{
if (log.IsEnabled())
Expand Down Expand Up @@ -302,7 +309,9 @@
internal struct SharedArrayPoolThreadLocalArray
{
/// <summary>The stored array.</summary>
public Array? Array;
// Must be an array of T[] at runtime
[RequiresUnsafe]

Check failure on line 313 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 checked)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L313

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(313,10): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafeAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 313 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 checked)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L313

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(313,10): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafe' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 313 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L313

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(313,10): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafeAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 313 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L313

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(313,10): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafe' could not be found (are you missing a using directive or an assembly reference?)
public unsafe Array? Array;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add [RequiresUnsafe]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Added [RequiresUnsafe] to SharedArrayPoolThreadLocalArray.Array field.

/// <summary>Environment.TickCount timestamp for when this array was observed by Trim.</summary>
public int MillisecondsTimeStamp;

Expand Down Expand Up @@ -390,6 +399,8 @@
private int _millisecondsTimestamp;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
// Array parameter must be a T[]
[RequiresUnsafe]

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 checked)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafeAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 checked)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafe' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 release)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafeAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab (Build linux-x64 release)

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafe' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafeAttribute' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 403 in src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs

View check run for this annotation

Azure Pipelines / runtimelab

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs#L403

src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs(403,14): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'RequiresUnsafe' could not be found (are you missing a using directive or an assembly reference?)
public bool TryPush(Array array)
{
bool enqueued = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,9 @@ internal Node(TKey key, TValue value, int hashcode, Node? next)
private sealed class Tables
{
/// <summary>The comparer to use for lookups in the tables.</summary>
internal readonly IEqualityComparer<TKey>? _comparer;
// Must be IAlternateEqualityComparer<TAlternateKey, TKey>
[RequiresUnsafe]
internal readonly unsafe IEqualityComparer<TKey>? _comparer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add [RequiresUnsafe]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Added [RequiresUnsafe] to Tables._comparer field.

/// <summary>A singly-linked list for each bucket.</summary>
internal readonly VolatileNode[] _buckets;
/// <summary>Pre-computed multiplier for use on 64-bit performing faster modulo operations.</summary>
Expand Down Expand Up @@ -2317,6 +2319,7 @@ private static bool IsCompatibleKey<TAlternateKey>(ConcurrentDictionary<TKey, TV

/// <summary>Gets the dictionary's alternate comparer. The dictionary must have already been verified as compatible.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[RequiresUnsafe]
private static IAlternateEqualityComparer<TAlternateKey, TKey> GetAlternateComparer<TAlternateKey>(ConcurrentDictionary<TKey, TValue>.Tables tables)
where TAlternateKey : notnull, allows ref struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary,
private int _freeList;
private int _freeCount;
private int _version;
private IEqualityComparer<TKey>? _comparer;
// Must be IAlternateEqualityComparer<TAlternateKey, TKey>
[RequiresUnsafe]
private unsafe IEqualityComparer<TKey>? _comparer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add [RequiresUnsafe]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Added [RequiresUnsafe] to _comparer field.

private KeyCollection? _keys;
private ValueCollection? _values;
private const int StartOfFreeList = -3;
Expand Down Expand Up @@ -734,6 +736,7 @@ internal static bool IsCompatibleKey(Dictionary<TKey, TValue> dictionary)

/// <summary>Gets the dictionary's alternate comparer. The dictionary must have already been verified as compatible.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[RequiresUnsafe]
internal static IAlternateEqualityComparer<TAlternateKey, TKey> GetAlternateComparer(Dictionary<TKey, TValue> dictionary)
{
Debug.Assert(IsCompatibleKey(dictionary));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public class HashSet<T> : ICollection<T>, ISet<T>, IReadOnlyCollection<T>, IRead
private int _freeList;
private int _freeCount;
private int _version;
private IEqualityComparer<T>? _comparer;
// Must be IAlternateEqualityComparer<TAlternate, T>
[RequiresUnsafe]
private unsafe IEqualityComparer<T>? _comparer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add [RequiresUnsafe]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit b73ffce. Added [RequiresUnsafe] to _comparer field.


#region Constructors

Expand Down Expand Up @@ -441,6 +443,7 @@ internal static bool IsCompatibleItem(HashSet<T> set)

/// <summary>Gets the set's alternate comparer. The set must have already been verified as compatible.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[RequiresUnsafe]
internal static IAlternateEqualityComparer<TAlternate, T> GetAlternateComparer(HashSet<T> set)
{
Debug.Assert(IsCompatibleItem(set));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ private void SetTarget(object? target, ComInfo? comInfo)
if (_comInfo != null)
{
// Check if the target is still null
target = Unsafe.As<T>(GCHandle.InternalGet(_weakHandle));
// FIXME: review unsafe to confirm correct annotation
unsafe
{
target = Unsafe.As<T>(GCHandle.InternalGet(_weakHandle));
}
if (target == null)
{
// Resolve and reset. Perform runtime cast to catch bugs
Expand Down Expand Up @@ -146,22 +150,40 @@ private static ComAwareWeakReference EnsureComAwareReference(ref nint taggedHand
GC.SuppressFinalize(newRef);
}

return Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
// FIXME: review unsafe to confirm correct annotation
unsafe
{
return Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ComAwareWeakReference GetFromTaggedReference(nint taggedHandle)
{
Debug.Assert((taggedHandle & ComAwareBit) != 0);
return Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
// FIXME: review unsafe to confirm correct annotation
unsafe
{
return Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
internal static void SetTarget(ref nint taggedHandle, object? target, ComInfo? comInfo)
{
ComAwareWeakReference comAwareRef = comInfo != null ?
EnsureComAwareReference(ref taggedHandle) :
Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
ComAwareWeakReference comAwareRef;
if (comInfo != null)
{
comAwareRef = EnsureComAwareReference(ref taggedHandle);
}
else
{
// FIXME: review unsafe to confirm correct annotation
unsafe
{
comAwareRef = Unsafe.As<ComAwareWeakReference>(GCHandle.InternalGet(taggedHandle & ~HandleTagBits)!);
}
}

comAwareRef.SetTarget(target, comInfo);
}
Expand Down
Loading
Loading