Skip to content

Conversation

jkoritzinsky
Copy link
Member

Fixes #119099

@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 19:10
Copy link
Contributor

@Copilot 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 addresses issue #119099 by adding custom operator delete overloads that delegate to unsized delete operators in classes that use dynamically calculated sizes in their custom new operators. This ensures proper cleanup when objects are destroyed, avoiding potential undefined behavior from relying on sized delete with incorrect size values.

Key changes:

  • Added custom sized operator delete overloads that call unsized ::operator delete
  • Applied this pattern consistently across three classes with dynamic size allocation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/coreclr/vm/virtualcallstub.h Added sized delete operator to FastTable class that delegates to unsized delete
src/coreclr/vm/methodtable.h Added sized delete operator to MethodDataObject class that delegates to unsized delete
src/coreclr/vm/crossloaderallocatorhash.h Added sized delete operator to KeyValueStore class that delegates to unsized delete

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

…lass as that's where the delete would route to.
jkoritzinsky and others added 2 commits August 27, 2025 12:28
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

:shipit:

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) August 27, 2025 20:22
@jkoritzinsky jkoritzinsky merged commit 38b8e81 into dotnet:main Aug 27, 2025
98 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLR] ASAN MethodData::Release() new-delete-type-mismatch

2 participants