Skip to content
Open
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
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
24 changes: 13 additions & 11 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 @@ -901,35 +902,36 @@ namespace BINDER_SPACE
_ASSERTE(pTpaEntry->m_wszILFileName != nullptr);
SString fileName(pTpaEntry->m_wszILFileName);

ReleaseHolder<Assembly> pAssembly;
SString getAssemblyDiag;
hr = GetAssembly(fileName,
TRUE, // fIsInTPA
&pTPAAssembly,
&pAssembly,
ProbeExtensionResult::Invalid(),
&getAssemblyDiag);
pBindResult->AppendDiagnosticInfo(getAssemblyDiag);
BinderTracing::PathProbed(fileName, BinderTracing::PathSource::ApplicationAssemblies, hr);

pBindResult->SetAttemptResult(hr, pTPAAssembly);
pBindResult->SetAttemptResult(hr, pAssembly);

// On file not found, simply fall back to app path probing
if (hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
// Any other error is fatal
IF_FAIL_GO(hr);

if (TestCandidateRefMatchesDef(pRequestedAssemblyName, pTPAAssembly->GetAssemblyName(), true /*tpaListAssembly*/))
if (TestCandidateRefMatchesDef(pRequestedAssemblyName, pAssembly->GetAssemblyName(), true /*tpaListAssembly*/))
{
// We have found the requested assembly match on TPA with validation of the full-qualified name. Bind to it.
pBindResult->SetResult(pTPAAssembly);
pBindResult->SetAttemptResult(S_OK, pTPAAssembly);
pBindResult->SetResult(pAssembly);
pBindResult->SetAttemptResult(S_OK, pAssembly);
GO_WITH_HRESULT(S_OK);
}
else
{
// We found the assembly on TPA but it didn't match the RequestedAssembly assembly-name. In this case, lets proceed to see if we find the requested
// assembly in the App paths.
pBindResult->SetAttemptResult(FUSION_E_REF_DEF_MISMATCH, pTPAAssembly);
pBindResult->SetAttemptResult(FUSION_E_REF_DEF_MISMATCH, pAssembly);
fPartialMatchOnTpa = true;
}
}
Expand Down Expand Up @@ -1030,7 +1032,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
11 changes: 6 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,19 +172,20 @@ 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;
}
}
}

pCoreCLRFoundAssembly.Free(); // Ensure we don't leak the previous assembly if we had one
hr = AssemblyBinderCommon::BindUsingPEImage(this, pAssemblyName, pPEImage, excludeAppPaths, &pCoreCLRFoundAssembly, ppExistingAssemblyOnConflict);
if (hr == S_OK)
{
_ASSERTE(pCoreCLRFoundAssembly != NULL);
pCoreCLRFoundAssembly->SetBinder(this);
*ppAssembly = pCoreCLRFoundAssembly.Extract();
*ppAssembly = pCoreCLRFoundAssembly.Detach();
}
Exit:;
}
Expand Down Expand Up @@ -221,7 +222,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>)
Comment thread
AaronRobinsonMSFT marked this conversation as resolved.

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
3 changes: 2 additions & 1 deletion src/coreclr/debug/createdump/threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ 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, nativeOffset, token, ilOffset);
pMethod.Detach();
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 @@ -6540,7 +6540,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
Loading
Loading