diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorDeclSecurity.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorDeclSecurity.cs index 4b89b8c64a..e2fa15714f 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorDeclSecurity.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorDeclSecurity.cs @@ -51,7 +51,7 @@ protected override void InitializeSecurityAttributes() { var data = MDAPI.GetPermissionSetBlob(mdi, token) ?? Array.Empty(); var gpContext = new GenericParamContext(); var tmp = DeclSecurityReader.Read(readerModule, data, gpContext); - Interlocked.CompareExchange(ref securityAttributes, tmp, null); + Interlocked.CompareExchange(ref securityAttributes, tmp, null!); } public override byte[] GetBlob() { diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorMethodDef.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorMethodDef.cs index 048b686359..990f76bb18 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorMethodDef.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorMethodDef.cs @@ -181,7 +181,7 @@ void InitGenericParams_NoLock() { protected override void InitializeOverrides() { var tmp = ownerType.GetMethodOverrides(this); - Interlocked.CompareExchange(ref overrides, tmp, null); + Interlocked.CompareExchange(ref overrides, tmp, null!); } protected override ImplMap? GetImplMap_NoLock() { diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorModuleDef.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorModuleDef.cs index 1068192824..a299d08fcf 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorModuleDef.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorModuleDef.cs @@ -943,7 +943,7 @@ CilBody ReadCilBody(IList parameters, uint rva, uint mdToken, Generic protected override void InitializeTypes() { var list = GetNonNestedClassRids(); var tmp = new LazyList(list.Length, this, list, (list2, index) => ResolveTypeDef(list2[index])); - Interlocked.CompareExchange(ref types, tmp, null); + Interlocked.CompareExchange(ref types, tmp, null!); } uint[] GetNonNestedClassRids() { @@ -1075,7 +1075,7 @@ uint[] GetNewTokens(uint rid) { protected override void InitializeExportedTypes() { var list = MDAPI.GetExportedTypeRids(MetaDataAssemblyImport); var tmp = new LazyList(list.Length, list, (list2, i) => ResolveExportedType(list2[i])); - Interlocked.CompareExchange(ref exportedTypes, tmp, null); + Interlocked.CompareExchange(ref exportedTypes, tmp, null!); lastExportedTypeRidInList = list.Length == 0 ? 0 : list.Max(); } @@ -1109,7 +1109,7 @@ public bool UpdateExportedTypes() { protected override void InitializeResources() { var list = MDAPI.GetManifestResourceRids(MetaDataAssemblyImport); var tmp = new ResourceCollection(list.Length, null, (ctx, i) => CreateResource((uint)i + 1)); - Interlocked.CompareExchange(ref resources, tmp, null); + Interlocked.CompareExchange(ref resources, tmp, null!); lastManifestResourceRidInList = list.Length == 0 ? 0 : list.Max(); } diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorTypeDef.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorTypeDef.cs index 64949c1dc5..c15e0e6124 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorTypeDef.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.CorDebug/dndbg/DotNet/CorTypeDef.cs @@ -409,7 +409,7 @@ void Add(Dictionary dict, IList methods, uint tok protected override void InitializeNestedTypes() { var list = readerModule.GetTypeDefNestedClassRids(this); var tmp = new LazyList(list.Length, this, list, (list2, index) => readerModule.ResolveTypeDef(list2[index])); - Interlocked.CompareExchange(ref nestedTypes, tmp, null); + Interlocked.CompareExchange(ref nestedTypes, tmp, null!); } } }