Skip to content
Merged
2 changes: 1 addition & 1 deletion src/coreclr/binder/assemblybindercommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ HRESULT AssemblyBinderCommon::CreateDefaultBinder(DefaultAssemblyBinder** ppDefa
hr = pApplicationContext->Init();
if (SUCCEEDED(hr))
{
pBinder->SetManagedAssemblyLoadContext(NULL);
pBinder->SetManagedAssemblyLoadContext((INT_PTR)NULL);
*ppDefaultBinder = pBinder.Extract();
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/binder/customassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,21 +242,21 @@ void CustomAssemblyBinder::PrepareForLoadContextRelease(INT_PTR ptrManagedStrong
CustomAssemblyBinder::CustomAssemblyBinder()
{
m_pDefaultBinder = NULL;
m_ptrManagedStrongAssemblyLoadContext = NULL;
m_ptrManagedStrongAssemblyLoadContext = (INT_PTR)NULL;
}

void CustomAssemblyBinder::ReleaseLoadContext()
{
VERIFY(GetManagedAssemblyLoadContext() != NULL);
VERIFY(m_ptrManagedStrongAssemblyLoadContext != NULL);
VERIFY(GetManagedAssemblyLoadContext() != (INT_PTR)NULL);
VERIFY(m_ptrManagedStrongAssemblyLoadContext != (INT_PTR)NULL);

// This method is called to release the weak and strong handles on the managed AssemblyLoadContext
// once the Unloading event has been fired
OBJECTHANDLE handle = reinterpret_cast<OBJECTHANDLE>(GetManagedAssemblyLoadContext());
DestroyLongWeakHandle(handle);
handle = reinterpret_cast<OBJECTHANDLE>(m_ptrManagedStrongAssemblyLoadContext);
DestroyHandle(handle);
SetManagedAssemblyLoadContext(NULL);
SetManagedAssemblyLoadContext((INT_PTR)NULL);

// The AssemblyLoaderAllocator is in a process of shutdown and should not be used
// after this point.
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/binder/defaultassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ HRESULT DefaultAssemblyBinder::BindUsingAssemblyName(BINDER_SPACE::AssemblyName
// Attempt to resolve the assembly via managed ALC instance. This can either fail the bind or return reference to an existing
// assembly that has been loaded
INT_PTR pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext();
if (pManagedAssemblyLoadContext == NULL)
if (pManagedAssemblyLoadContext == (INT_PTR)NULL)
{
// For satellite assemblies, the managed ALC has additional resolution logic (defined by the runtime) which
// should be run even if the managed default ALC has not yet been used. (For non-satellite assemblies, any
Expand All @@ -78,11 +78,11 @@ HRESULT DefaultAssemblyBinder::BindUsingAssemblyName(BINDER_SPACE::AssemblyName
CALL_MANAGED_METHOD_NORET(args)

pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext();
_ASSERTE(pManagedAssemblyLoadContext != NULL);
_ASSERTE(pManagedAssemblyLoadContext != (INT_PTR)NULL);
}
}

if (pManagedAssemblyLoadContext != NULL)
if (pManagedAssemblyLoadContext != (INT_PTR)NULL)
{
hr = AssemblyBinderCommon::BindUsingHostAssemblyResolver(pManagedAssemblyLoadContext, pAssemblyName,
NULL, this, &pCoreCLRFoundAssembly);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/classlibnative/bcltype/arraynative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C" PCODE QCALLTYPE Array_GetElementConstructorEntrypoint(QCall::TypeHand
{
QCALL_CONTRACT;

PCODE ctorEntrypoint = NULL;
PCODE ctorEntrypoint = (PCODE)NULL;

BEGIN_QCALL;

Expand Down
18 changes: 9 additions & 9 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4324,7 +4324,7 @@ ClrDataAccess::TranslateExceptionRecordToNotification(
GcEvtArgs pubGcEvtArgs = {};
ULONG32 notifyType = 0;
DWORD catcherNativeOffset = 0;
TADDR nativeCodeLocation = NULL;
TADDR nativeCodeLocation = (TADDR)NULL;

DAC_ENTER();

Expand Down Expand Up @@ -4706,7 +4706,7 @@ ClrDataAccess::SetAllCodeNotifications(
BOOL changedTable;
TADDR modulePtr = mod ?
PTR_HOST_TO_TADDR(((ClrDataModule*)mod)->GetModule()) :
NULL;
(TADDR)NULL;

if (jn.SetAllNotifications(modulePtr, (USHORT)flags, &changedTable))
{
Expand Down Expand Up @@ -4822,7 +4822,7 @@ ClrDataAccess::GetCodeNotifications(
}
else
{
TADDR modulePtr = NULL;
TADDR modulePtr = (TADDR)NULL;
if (singleMod)
{
modulePtr = PTR_HOST_TO_TADDR(((ClrDataModule*)singleMod)->
Expand Down Expand Up @@ -4908,7 +4908,7 @@ ClrDataAccess::SetCodeNotifications(
goto Exit;
}

TADDR modulePtr = NULL;
TADDR modulePtr = (TADDR)NULL;
if (singleMod)
{
modulePtr =
Expand Down Expand Up @@ -5952,10 +5952,10 @@ ClrDataAccess::GetMethodVarInfo(MethodDesc* methodDesc,
COUNT_T countNativeVarInfo;
NewHolder<ICorDebugInfo::NativeVarInfo> nativeVars(NULL);
TADDR nativeCodeStartAddr;
if (address != NULL)
if (address != (TADDR)NULL)
{
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == (PCODE)NULL)
{
return E_INVALIDARG;
}
Expand Down Expand Up @@ -6010,10 +6010,10 @@ ClrDataAccess::GetMethodNativeMap(MethodDesc* methodDesc,
// Use the DebugInfoStore to get IL->Native maps.
// It doesn't matter whether we're jitted, ngenned etc.
TADDR nativeCodeStartAddr;
if (address != NULL)
if (address != (TADDR)NULL)
{
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == (PCODE)NULL)
{
return E_INVALIDARG;
}
Expand Down Expand Up @@ -6947,7 +6947,7 @@ ClrDataAccess::GetDacGlobalValues()
{
return CORDBG_E_MISSING_DEBUGGER_EXPORTS;
}
if (m_dacGlobals.ThreadStore__s_pThreadStore == NULL)
if (m_dacGlobals.ThreadStore__s_pThreadStore == (TADDR)NULL)
{
return CORDBG_E_UNSUPPORTED;
}
Expand Down
50 changes: 25 additions & 25 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ mdSignature DacDbiInterfaceImpl::GetILCodeAndSigHelper(Module * pModule,
pIL->cbSize = header.GetCodeSize();

// Now we get the signature token
if (header.LocalVarSigTok != NULL)
if (header.LocalVarSigTok != mdTokenNil)
{
mdSig = header.GetLocalVarSigTok();
}
Expand Down Expand Up @@ -1314,14 +1314,14 @@ void DacDbiInterfaceImpl::GetMethodRegionInfo(MethodDesc * pMethodDe
}
CONTRACTL_END;

IJitManager::MethodRegionInfo methodRegionInfo = {NULL, 0, NULL, 0};
IJitManager::MethodRegionInfo methodRegionInfo = {(TADDR)NULL, 0, (TADDR)NULL, 0};
PCODE functionAddress = pMethodDesc->GetNativeCode();

// get the start address of the hot region and initialize the jit manager
pCodeInfo->m_rgCodeRegions[kHot].pAddress = CORDB_ADDRESS(PCODEToPINSTR(functionAddress));

// if the start address is NULL, the code isn't available yet, so just return
if (functionAddress != NULL)
if (functionAddress != (PCODE)NULL)
{
EECodeInfo codeInfo(functionAddress);
_ASSERTE(codeInfo.IsValid());
Expand Down Expand Up @@ -1372,7 +1372,7 @@ void DacDbiInterfaceImpl::GetNativeCodeInfo(VMPTR_DomainAssembly vmDomai
if(pMethodDesc != NULL)
{
GetMethodRegionInfo(pMethodDesc, pCodeInfo);
if (pCodeInfo->m_rgCodeRegions[kHot].pAddress != NULL)
if (pCodeInfo->m_rgCodeRegions[kHot].pAddress != (CORDB_ADDRESS)NULL)
{
pCodeInfo->isInstantiatedGeneric = pMethodDesc->HasClassOrMethodInstantiation();
LookupEnCVersions(pModule,
Expand All @@ -1397,14 +1397,14 @@ void DacDbiInterfaceImpl::GetNativeCodeInfoForAddr(VMPTR_MethodDesc vmMe

_ASSERTE(pCodeInfo != NULL);

if (hotCodeStartAddr == NULL)
if (hotCodeStartAddr == (CORDB_ADDRESS)NULL)
{
// if the start address is NULL, the code isn't available yet, so just return
_ASSERTE(!pCodeInfo->IsValid());
return;
}

IJitManager::MethodRegionInfo methodRegionInfo = {NULL, 0, NULL, 0};
IJitManager::MethodRegionInfo methodRegionInfo = {(TADDR)NULL, 0, (TADDR)NULL, 0};
TADDR codeAddr = CORDB_ADDRESS_TO_TADDR(hotCodeStartAddr);

#ifdef TARGET_ARM
Expand Down Expand Up @@ -1655,7 +1655,7 @@ void DacDbiInterfaceImpl::ComputeFieldData(PTR_FieldDesc pFD,

if (pCurrentFieldData->OkToGetOrSetStaticAddress())
{
pCurrentFieldData->SetStaticAddress(NULL);
pCurrentFieldData->SetStaticAddress((TADDR)NULL);
}
}
else
Expand Down Expand Up @@ -3192,7 +3192,7 @@ CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadStaticAddress(VMPTR_FieldDesc vmFiel

Thread * pRuntimeThread = vmRuntimeThread.GetDacPtr();
PTR_FieldDesc pFieldDesc = vmField.GetDacPtr();
TADDR fieldAddress = NULL;
TADDR fieldAddress = (TADDR)NULL;

_ASSERTE(pRuntimeThread != NULL);

Expand Down Expand Up @@ -3441,15 +3441,15 @@ HRESULT DacDbiInterfaceImpl::GetDelegateType(VMPTR_Object delegateObject, Delega

PTR_Object pInvocationList = OBJECTREFToObject(pDelObj->GetInvocationList());

if (invocationCount == NULL)
if (invocationCount == 0)
{
if (pInvocationList == NULL)
{
// If this delegate points to a static function or this is a open virtual delegate, this should be non-null
// Special case: This might fail in a VSD delegate (instance open virtual)...
// TODO: There is the special signatures cases missing.
TADDR targetMethodPtr = PCODEToPINSTR(pDelObj->GetMethodPtrAux());
if (targetMethodPtr == NULL)
if (targetMethodPtr == (TADDR)NULL)
{
// Static extension methods, other closed static delegates, and instance delegates fall into this category.
*delegateType = kClosedDelegate;
Expand Down Expand Up @@ -3501,7 +3501,7 @@ HRESULT DacDbiInterfaceImpl::GetDelegateFunctionData(

HRESULT hr = S_OK;
PTR_DelegateObject pDelObj = dac_cast<PTR_DelegateObject>(delegateObject.GetDacPtr());
TADDR targetMethodPtr = NULL;
TADDR targetMethodPtr = (TADDR)NULL;
VMPTR_MethodDesc pMD;

switch (delegateType)
Expand Down Expand Up @@ -3552,7 +3552,7 @@ HRESULT DacDbiInterfaceImpl::GetDelegateTargetObject(
}

default:
ppTargetObj->SetDacTargetPtr(NULL);
ppTargetObj->SetDacTargetPtr((TADDR)NULL);
break;
}

Expand Down Expand Up @@ -4388,7 +4388,7 @@ void DacDbiInterfaceImpl::GetModuleData(VMPTR_Module vmModule, ModuleInfo * pDat

// Get PE BaseAddress and Size
// For dynamic modules, these are 0. Else,
pData->pPEBaseAddress = NULL;
pData->pPEBaseAddress = (CORDB_ADDRESS)NULL;
pData->nPESize = 0;

if (!fIsDynamic)
Expand Down Expand Up @@ -4765,7 +4765,7 @@ BOOL DacDbiInterfaceImpl::HasUnhandledException(VMPTR_Thread vmThread)
// most managed exceptions are just a throwable bound to a
// native exception. In that case this handle will be non-null
OBJECTHANDLE ohException = pThread->GetThrowableAsHandle();
if (ohException != NULL)
if (ohException != (OBJECTHANDLE)NULL)
{
// during the UEF we set the unhandled bit, if it is set the exception
// was unhandled
Expand Down Expand Up @@ -4854,7 +4854,7 @@ VMPTR_OBJECTHANDLE DacDbiInterfaceImpl::GetCurrentException(VMPTR_Thread vmThrea
// OBJECTHANDLEs are really just TADDRs.
OBJECTHANDLE ohException = pThread->GetThrowableAsHandle(); // ohException can be NULL

if (ohException == NULL)
if (ohException == (OBJECTHANDLE)NULL)
{
if (pThread->IsLastThrownObjectUnhandled())
{
Expand All @@ -4872,7 +4872,7 @@ VMPTR_OBJECTHANDLE DacDbiInterfaceImpl::GetObjectForCCW(CORDB_ADDRESS ccwPtr)
{
DD_ENTER_MAY_THROW;

OBJECTHANDLE ohCCW = NULL;
OBJECTHANDLE ohCCW = (OBJECTHANDLE)NULL;

#ifdef FEATURE_COMWRAPPERS
if (DACTryGetComWrappersHandleFromCCW(ccwPtr, &ohCCW) != S_OK)
Expand Down Expand Up @@ -4963,13 +4963,13 @@ CLR_DEBUGGING_PROCESS_FLAGS DacDbiInterfaceImpl::GetAttachStateFlags()
// Non-null Target Address of hijack function.
TADDR DacDbiInterfaceImpl::GetHijackAddress()
{
TADDR addr = NULL;
TADDR addr = (TADDR)NULL;
if (g_pDebugger != NULL)
{
// Get the start address of the redirect function for unhandled exceptions.
addr = dac_cast<TADDR>(g_pDebugger->m_rgHijackFunction[Debugger::kUnhandledException].StartAddress());
}
if (addr == NULL)
if (addr == (TADDR)NULL)
{
ThrowHR(CORDBG_E_NOTREADY);
}
Expand Down Expand Up @@ -5209,8 +5209,8 @@ void DacDbiInterfaceImpl::Hijack(
// space used by the OS exception dispatcher. We are using the latter approach here.
//

CORDB_ADDRESS espOSContext = NULL;
CORDB_ADDRESS espOSRecord = NULL;
CORDB_ADDRESS espOSContext = (CORDB_ADDRESS)NULL;
CORDB_ADDRESS espOSRecord = (CORDB_ADDRESS)NULL;
if (pThread != NULL && pThread->IsExceptionInProgress())
{
espOSContext = (CORDB_ADDRESS)PTR_TO_TADDR(pThread->GetExceptionState()->GetContextRecord());
Expand Down Expand Up @@ -5360,10 +5360,10 @@ TargetBuffer DacDbiInterfaceImpl::GetVarArgSig(CORDB_ADDRESS VASigCookieAddr,
DD_ENTER_MAY_THROW;

_ASSERTE(pArgBase != NULL);
*pArgBase = NULL;
*pArgBase = (CORDB_ADDRESS)NULL;

// First, read the VASigCookie pointer.
TADDR taVASigCookie = NULL;
TADDR taVASigCookie = (TADDR)NULL;
SafeReadStructOrThrow(VASigCookieAddr, &taVASigCookie);

// Now create a DAC copy of VASigCookie.
Expand Down Expand Up @@ -5665,7 +5665,7 @@ CORDB_ADDRESS DacDbiInterfaceImpl::GetDebuggerControlBlockAddress()
return CORDB_ADDRESS(dac_cast<TADDR>(g_pDebugger->m_pRCThread->GetDCB()));
}

return NULL;
return (CORDB_ADDRESS)NULL;
}

// DacDbi API: Get the context for a particular thread of the target process
Expand Down Expand Up @@ -6541,7 +6541,7 @@ HRESULT DacHeapWalker::Init(CORDB_ADDRESS start, CORDB_ADDRESS end)
if (ctx == NULL)
continue;

if ((CORDB_ADDRESS)ctx->alloc_ptr != NULL)
if ((CORDB_ADDRESS)ctx->alloc_ptr != (CORDB_ADDRESS)NULL)
{
mAllocInfo[j].Ptr = (CORDB_ADDRESS)ctx->alloc_ptr;
mAllocInfo[j].Limit = (CORDB_ADDRESS)ctx->alloc_limit;
Expand Down Expand Up @@ -6856,7 +6856,7 @@ HRESULT DacDbiInterfaceImpl::WalkHeap(HeapWalkHandle handle,
{
objects[i].address = addr;
objects[i].type.token1 = mt;
objects[i].type.token2 = NULL;
objects[i].type.token2 = 0;
objects[i].size = size;
i++;
}
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void DacDbiInterfaceImpl::EnumerateInternalFrames(VMPTR_Thread
}
else
{
frameData.stubFrame.funcMetadataToken = (pMD == NULL ? NULL : pMD->GetMemberDef());
frameData.stubFrame.funcMetadataToken = (pMD == NULL ? mdTokenNil : pMD->GetMemberDef());
frameData.stubFrame.vmDomainAssembly.SetHostPtr(pDomainAssembly);
frameData.stubFrame.vmMethodDesc.SetHostPtr(pMD);
}
Expand Down Expand Up @@ -832,7 +832,7 @@ void DacDbiInterfaceImpl::InitFrameData(StackFrameIterator * pIter,
}
else
{
pFrameData->v.exactGenericArgsToken = NULL;
pFrameData->v.exactGenericArgsToken = (GENERICS_TYPE_TOKEN)NULL;
pFrameData->v.dwExactGenericArgsTokenIndex = (DWORD)ICorDebugInfo::MAX_ILNUM;
}

Expand Down Expand Up @@ -1249,7 +1249,7 @@ void DacDbiInterfaceImpl::UpdateContextFromRegDisp(REGDISPLAY * pRegDisp,

PTR_CONTEXT DacDbiInterfaceImpl::RetrieveHijackedContext(REGDISPLAY * pRD)
{
CORDB_ADDRESS ContextPointerAddr = NULL;
CORDB_ADDRESS ContextPointerAddr = (CORDB_ADDRESS)NULL;

TADDR controlPC = PCODEToPINSTR(GetControlPC(pRD));

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/dacfn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ HRESULT DacReplacePatchesInHostMemory(MemoryRange range, PVOID pBuffer)
{
CORDB_ADDRESS patchAddress = (CORDB_ADDRESS)dac_cast<TADDR>(pPatch->address);

if (patchAddress != NULL)
if (patchAddress != (CORDB_ADDRESS)NULL)
{
PRD_TYPE opcode = pPatch->opcode;

Expand Down
Loading