Skip to content
Merged
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
fix Alpine build break
Apline defines NULL as std::nullptr which is not comparable/assignable
with intptr_t

Fixes dotnet/source-build#4345
  • Loading branch information
lambdageek committed Apr 19, 2024
commit d77b76d0f5c1842a4ffb4c70aabe7a1530e72631
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/cdac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CDAC::CDAC(HMODULE module, uint64_t descriptorAddr, ICorDebugDataTarget* target)
{
if (m_module == NULL)
{
m_cdac_handle = NULL;
m_cdac_handle = 0;
Copy link
Member

Choose a reason for hiding this comment

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

looks like the approach in #100796 was to cast NULL to INT_PTR instead

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's a style preference. in this case m_cdac_handle isn't a pointer (it happens to be a NativeAOT GCHandle), so (INT_PTR)NULL isn't really apropriate, either.

return;
}

Expand All @@ -62,7 +62,7 @@ CDAC::CDAC(HMODULE module, uint64_t descriptorAddr, ICorDebugDataTarget* target)

CDAC::~CDAC()
{
if (m_cdac_handle != NULL)
if (m_cdac_handle)
{
decltype(&cdac_reader_free) free = reinterpret_cast<decltype(&cdac_reader_free)>(::GetProcAddress(m_module, "cdac_reader_free"));
_ASSERTE(free != nullptr);
Expand Down