Skip to content
Open
2 changes: 1 addition & 1 deletion src/coreclr/binder/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace BINDER_SPACE
m_pPEImage = pPEImage;

// Now take ownership of assembly name
m_pAssemblyName = pAssemblyName.Extract();
m_pAssemblyName = pAssemblyName.Detach();

Exit:
return hr;
Expand Down
11 changes: 6 additions & 5 deletions src/coreclr/binder/assemblybindercommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ namespace BINDER_SPACE

IF_FAIL_GO(hr);

*ppSystemAssembly = pSystemAssembly.Extract();
*ppSystemAssembly = pSystemAssembly.Detach();

Exit:
return hr;
Expand Down Expand Up @@ -382,7 +382,7 @@ namespace BINDER_SPACE
probeExtensionResult));
BinderTracing::PathProbed(sCoreLibSatellite, pathSource, hr);

*ppSystemAssembly = pSystemAssembly.Extract();
*ppSystemAssembly = pSystemAssembly.Detach();

Exit:
return hr;
Expand Down Expand Up @@ -790,7 +790,8 @@ namespace BINDER_SPACE
}

// Set any found assembly. It is up to the caller to check the returned HRESULT for errors due to validation
*ppAssembly = pAssembly.Extract();
Assembly* pFoundAssembly = pAssembly.Detach();
*ppAssembly = pFoundAssembly;
if (FAILED(hr))
return hr;

Expand All @@ -800,7 +801,7 @@ namespace BINDER_SPACE
// we fail the bind.

// Compare requested AssemblyName with that from the candidate assembly
if (!TestCandidateRefMatchesDef(pRequestedAssemblyName, pAssembly->GetAssemblyName(), false /*tpaListAssembly*/))
if (!TestCandidateRefMatchesDef(pRequestedAssemblyName, pFoundAssembly->GetAssemblyName(), false /*tpaListAssembly*/))
return FUSION_E_REF_DEF_MISMATCH;

return S_OK;
Expand Down Expand Up @@ -1030,7 +1031,7 @@ namespace BINDER_SPACE
}

// We're done
*ppAssembly = pAssembly.Extract();
*ppAssembly = pAssembly.Detach();

Exit:

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/binder/customassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ HRESULT CustomAssemblyBinder::BindUsingAssemblyName(BINDER_SPACE::AssemblyName*
// For TPA assemblies that were bound, DefaultBinder
// would have already set the binder reference for the assembly, so we just need to
// extract the reference now.
*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();

Exit:;

Expand Down Expand Up @@ -139,7 +139,7 @@ HRESULT CustomAssemblyBinder::BindUsingPEImage( /* in */ PEImage *pPEImage,
{
_ASSERTE(pCoreCLRFoundAssembly != NULL);
pCoreCLRFoundAssembly->SetBinder(this);
*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();
}
Exit:;
}
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/binder/defaultassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ HRESULT DefaultAssemblyBinder::BindUsingAssemblyName(BINDER_SPACE::AssemblyName

IF_FAIL_GO(hr);

*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();

Exit:;

Expand Down Expand Up @@ -162,7 +162,7 @@ HRESULT DefaultAssemblyBinder::BindUsingPEImage( /* in */ PEImage *pPEImage,
{
if (pCoreCLRFoundAssembly->GetIsInTPA())
{
*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();
goto Exit;
}
}
Expand All @@ -172,7 +172,7 @@ HRESULT DefaultAssemblyBinder::BindUsingPEImage( /* in */ PEImage *pPEImage,
// Return the existing assembly so the caller can provide an informative error message.
if (ppExistingAssemblyOnConflict != nullptr)
{
*ppExistingAssemblyOnConflict = pExistingAssembly.Extract();
*ppExistingAssemblyOnConflict = pExistingAssembly.Detach();
}
goto Exit;
}
Expand All @@ -184,7 +184,7 @@ HRESULT DefaultAssemblyBinder::BindUsingPEImage( /* in */ PEImage *pPEImage,
{
_ASSERTE(pCoreCLRFoundAssembly != NULL);
pCoreCLRFoundAssembly->SetBinder(this);
*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();
}
Exit:;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ HRESULT DefaultAssemblyBinder::BindToSystem(BINDER_SPACE::Assembly** ppSystemAss
if (SUCCEEDED(hr))
{
_ASSERTE(pAsm != NULL);
*ppSystemAssembly = pAsm.Extract();
*ppSystemAssembly = pAsm.Detach();
(*ppSystemAssembly)->SetBinder(this);
}

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include(${CMAKE_CURRENT_LIST_DIR}/clrfeatures.cmake)

add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>:DACCESS_COMPILE>)
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:DBI_COMPILE>)

if (CLR_CMAKE_TARGET_UNIX)

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/createdump/crashinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ CrashInfo::InitializeDAC(DumpType dumpType)
printf_error("InitializeDAC: coreclr not found; not using DAC\n");
return true;
}
ReleaseHolder<DumpDataTarget> dataTarget = new DumpDataTarget(*this);
ReleaseHolder<DumpDataTarget> dataTarget{ new DumpDataTarget(*this) };
PFN_CLRDataCreateInstance pfnCLRDataCreateInstance = nullptr;
PFN_DLLMAIN pfnDllMain = nullptr;
bool result = false;
Expand Down Expand Up @@ -483,7 +483,7 @@ CrashInfo::UnwindAllThreads()
if (m_appModel != AppModelType::NativeAOT)
{
TRACE("UnwindAllThreads: STARTED (%d)\n", m_dataTargetPagesAdded);
ReleaseHolder<ISOSDacInterface> pSos = nullptr;
ReleaseHolder<ISOSDacInterface> pSos;
if (m_pClrDataProcess != nullptr) {
m_pClrDataProcess->QueryInterface(__uuidof(ISOSDacInterface), (void**)&pSos);
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/createdump/createdumpunix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ long g_pageSize = 0;
bool
CreateDump(const CreateDumpOptions& options)
{
ReleaseHolder<CrashInfo> crashInfo = new CrashInfo(options);
ReleaseHolder<CrashInfo> crashInfo{ new CrashInfo(options) };
DumpWriter dumpWriter(*crashInfo);
std::string dumpPath;
bool result = false;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/createdump/threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ThreadInfo::GatherStackFrames(CONTEXT* pContext, IXCLRDataStackWalk* pStackwalk)
}

// Add managed stack frame for the crash info notes
StackFrame frame(moduleAddress, ip, sp, pMethod.Extract(), nativeOffset, token, ilOffset);
StackFrame frame(moduleAddress, ip, sp, pMethod.Detach(), nativeOffset, token, ilOffset);
AddStackFrame(frame);
}

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/cdac.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CDAC final
CDAC(CDAC&& other)
: m_module{ other.m_module }
, m_cdac_handle{ other.m_cdac_handle }
, m_target{ other.m_target.Extract() }
, m_target{ other.m_target.Detach() }
, m_legacyImpl{ other.m_legacyImpl }
{
other.m_module = NULL;
Expand All @@ -31,7 +31,7 @@ class CDAC final
{
m_module = other.m_module;
m_cdac_handle = other.m_cdac_handle;
m_target = other.m_target.Extract();
m_target = other.m_target.Detach();
m_legacyImpl = other.m_legacyImpl;

other.m_module = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6541,7 +6541,7 @@ CLRDataCreateInstance(REFIID iid,
#endif

// TODO: [cdac] Remove when cDAC deploys with SOS - https://github.com/dotnet/runtime/issues/108720
ReleaseHolder<IUnknown> cdacInterface = nullptr;
ReleaseHolder<IUnknown> cdacInterface;
#ifdef CAN_USE_CDAC
CLRConfigNoCache enable = CLRConfigNoCache::Get("ENABLE_CDAC");
if (enable.IsSet())
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ DacDbiInterfaceInstance(
cdac = CDAC::Create(contractDescriptorAddr, pDac->m_pTarget, legacyImpl);
if (cdac.IsValid())
{
ReleaseHolder<IUnknown> cdacInterface = nullptr;
ReleaseHolder<IUnknown> cdacInterface;
cdac.CreateDacDbiInterface(&cdacInterface);
if (cdacInterface != nullptr)
{
Expand Down
34 changes: 17 additions & 17 deletions src/coreclr/debug/daccess/enummem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,13 @@ HRESULT ClrDataAccess::EnumMemWalkStackHelper(CLRDataEnumMemoryFlags flags,
if (SUCCEEDED(pMethod->GetTypeInstance(&pTypeInstance)) &&
(pTypeInstance != NULL))
{
pTypeInstance.Clear();
pTypeInstance.Free();
}

if(SUCCEEDED(pMethod->GetDefinition(&pMethodDefinition)) &&
(pMethodDefinition != NULL))
{
pMethodDesc = ((ClrDataMethodDefinition *)pMethodDefinition.GetValue())->GetMethodDesc();
pMethodDesc = ((ClrDataMethodDefinition *)(IXCLRDataMethodDefinition*)pMethodDefinition)->GetMethodDesc();
if (pMethodDesc)
{

Expand Down Expand Up @@ -998,11 +998,11 @@ HRESULT ClrDataAccess::EnumMemWalkStackHelper(CLRDataEnumMemoryFlags flags,
}
#endif // USE_GC_INFO_DECODER
}
pMethodDefinition.Clear();
pMethodDefinition.Free();
}
pMethod.Clear();
pMethod.Free();
}
pFrame.Clear();
pFrame.Free();
}

previousSP = currentSP;
Expand Down Expand Up @@ -1144,7 +1144,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_TRY
{
// get Thread *
pThread = ((ClrDataTask *)pIXCLRDataTask.GetValue())->GetThread();
pThread = ((ClrDataTask*)(IXCLRDataTask*)pIXCLRDataTask)->GetThread();

// dump the exception object
DumpManagedExcepObject(flags, pThread->LastThrownObject());
Expand All @@ -1156,7 +1156,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_TRY
{
// touch the throwable in exception state
PTR_UNCHECKED_OBJECTREF throwRef(((ClrDataExceptionState *)pExcepState.GetValue())->m_throwable);
PTR_UNCHECKED_OBJECTREF throwRef(((ClrDataExceptionState*)(IXCLRDataExceptionState*)pExcepState)->m_throwable);

// If we've already attempted enumeration for this exception, it's time to quit.
if (!exceptionTrackingInner.AddNewAddressOnly(throwRef.GetAddr()))
Expand All @@ -1180,7 +1180,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED

// get next thread
pIXCLRDataTask.Clear();
pIXCLRDataTask.Free();
status = EnumTask(&handle, &pIXCLRDataTask);
}
EndEnumTasks(handle);
Expand Down Expand Up @@ -1222,7 +1222,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_TRY
{
// get Thread *
pThread = ((ClrDataTask *)pIXCLRDataTask.GetValue())->GetThread();
pThread = ((ClrDataTask*)(IXCLRDataTask*)pIXCLRDataTask)->GetThread();

// Write out the Thread instance
DacEnumHostDPtrMem(pThread);
Expand All @@ -1248,7 +1248,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
if (status == S_OK && pStackWalk != NULL)
{
status = EnumMemWalkStackHelper(flags, pStackWalk, pThread);
pStackWalk.Clear();
pStackWalk.Free();
}

// Now probe into the exception info
Expand All @@ -1258,7 +1258,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_TRY
{
// touch the throwable in exception state
PTR_UNCHECKED_OBJECTREF throwRef(((ClrDataExceptionState *)pExcepState.GetValue())->m_throwable);
PTR_UNCHECKED_OBJECTREF throwRef(((ClrDataExceptionState*)(IXCLRDataExceptionState*)pExcepState)->m_throwable);

// If we've already attempted enumeration for this exception, it's time to quit.
if (!exceptionTracking.AddNewAddressOnly(throwRef.GetAddr()))
Expand All @@ -1278,7 +1278,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
ReleaseHolder<IXCLRDataTypeInstance> pTypeInstance(NULL);
// Make sure that we can get back a TypeInstance during inspection
status = pValue->GetType(&pTypeInstance);
pValue.Clear();
pValue.Free();
}

// If Exception state has a new context, we will walk with the stashed context as well.
Expand All @@ -1290,7 +1290,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
// to walk the stack correctly here. Anyway, we try to catch exception thrown
// by bad stack walk in EnumMemWalkStackHelper.
//
PTR_CONTEXT pContext = ((ClrDataExceptionState*)pExcepState.GetValue())->GetCurrentContextRecord();
PTR_CONTEXT pContext = ((ClrDataExceptionState*)(IXCLRDataExceptionState*)pExcepState)->GetCurrentContextRecord();
if (pContext != NULL)
{
T_CONTEXT newContext;
Expand All @@ -1306,7 +1306,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
{
status = EnumMemWalkStackHelper(flags, pStackWalk, pThread);
}
pStackWalk.Clear();
pStackWalk.Free();
}
}
}
Expand All @@ -1324,7 +1324,7 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags)
EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED

// get next thread
pIXCLRDataTask.Clear();
pIXCLRDataTask.Free();
status = EnumTask(&handle, &pIXCLRDataTask);
}
EndEnumTasks(handle);
Expand Down Expand Up @@ -1381,7 +1381,7 @@ HRESULT ClrDataAccess::EnumMemStowedException(CLRDataEnumMemoryFlags flags)
}
EX_TRY
{
if (((ClrDataTask *)pIXCLRDataTask.GetValue())->GetThread()->GetOSThreadId() == exThreadID)
if (((ClrDataTask*)(IXCLRDataTask*)pIXCLRDataTask)->GetThread()->GetOSThreadId() == exThreadID)
{
// found the thread
foundThread = TRUE;
Expand All @@ -1391,7 +1391,7 @@ HRESULT ClrDataAccess::EnumMemStowedException(CLRDataEnumMemoryFlags flags)
EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED

// get next thread
pIXCLRDataTask.Clear();
pIXCLRDataTask.Free();
status = EnumTask(&handle, &pIXCLRDataTask);
}
EndEnumTasks(handle);
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ void Debugger::getBoundariesHelper(MethodDesc * md,
(void)pModule; //prevent "unused variable" error from GCC
_ASSERTE(pModule != NULL);

ComHolderPreemp<ISymUnmanagedReader> pReader(pModule->GetISymUnmanagedReader());
ReleaseHolder<ISymUnmanagedReader> pReader(pModule->GetISymUnmanagedReader());

// If we got a reader, use it.
if (pReader != NULL)
Expand Down Expand Up @@ -11779,7 +11779,7 @@ void Debugger::GetAndSendTransitionStubInfo(CORDB_ADDRESS_TYPE *stubAddress)
// If its not a stub, then maybe its an address in mscoree?
if (result == false)
{
result = (IsIPInModule(GetClrModuleBase(), (PCODE)stubAddress) == TRUE);
result = (g_pEEInterface->IsIPInModule(GetClrModuleBase(), (PCODE)stubAddress) == TRUE);
}

// This is a synchronous event (reply required)
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/dlls/mscoree/exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ int coreclr_initialize(

if (SUCCEEDED(hr))
{
host.SuppressRelease();
*hostHandle = host;
*hostHandle = host.Detach();
#ifdef FEATURE_GDBJIT
HRESULT createDelegateResult;
createDelegateResult = coreclr_create_delegate(*hostHandle,
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/check.inl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define CHECK_INL_

#include "check.h"
#include "clrhost.h"
#include "debugmacros.h"
#include "clrtypes.h"

Expand Down
Loading
Loading