Skip to content

Conversation

@jkoritzinsky
Copy link
Member

This was causing asan errors.

Fixes #121339

This was causing asan errors.

Fixes #121339
Copilot AI review requested due to automatic review settings November 5, 2025 03:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes an unnecessary C-style cast when deleting a USynchCacheStackNode pointer in the Add method of the CSynchCache template class.

Key Changes:

  • Simplified the delete operation by removing the (char *) cast in the Add method, making the code cleaner and type-safe.
Comments suppressed due to low confidence (1)

src/coreclr/pal/src/include/pal/synchcache.hpp:181

  • The Flush method on line 181 still uses the same C-style cast pattern delete (char *)pTemp; that was just removed from line 156. For consistency and type safety, this should also be changed to delete pTemp; since pTemp is already a USynchCacheStackNode * pointer allocated with new USynchCacheStackNode().
                delete (char *)pTemp;

@jkotas
Copy link
Member

jkotas commented Nov 5, 2025

/ba-g Android timeouts

@jkotas jkotas merged commit 6d0ac32 into main Nov 5, 2025
103 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLR] ASAN CloseHandle new-delete-type-mismatch

3 participants