Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete null comparisons of non-null arguments #64435

Merged
merged 1 commit into from
Jan 28, 2022
Merged
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
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/DebugHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ extern "C" void PopulateDebugHeaders()
size_t currentDebugPos = 0;
size_t currentGlobalPos = 0;

ZeroMemory(s_DebugEntries, DebugTypeEntriesArraySize);
ZeroMemory(s_GlobalEntries, GlobalEntriesArraySize);
ZeroMemory(s_DebugEntries, sizeof(s_DebugEntries));
ZeroMemory(s_GlobalEntries, sizeof(s_GlobalEntries));

MAKE_SIZE_ENTRY(GcDacVars);
MAKE_DEBUG_FIELD_ENTRY(GcDacVars, major_version_number);
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/nativeaot/Runtime/MethodTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ bool MethodTable::Validate(bool assertOnFail /* default: true */)
{
#define REPORT_FAILURE() do { if (assertOnFail) { ASSERT_UNCONDITIONALLY("MethodTable::Validate check failed"); } return false; } while (false)

// Deal with the most common case of a bad pointer without an exception.
if (this == NULL)
REPORT_FAILURE();

// MethodTable structures should be at least pointer aligned.
if (dac_cast<TADDR>(this) & (sizeof(TADDR)-1))
REPORT_FAILURE();
Expand Down