Skip to content

IRGen: correct some type deletion #83321

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

Merged
merged 1 commit into from
Jul 27, 2025
Merged

Conversation

compnerd
Copy link
Member

ASAN identified mismatched operator new and operator delete on these types. The reason for this is the sized allocation for the tail packing involved. Provide the associated operator delete that releases the memory. Note that the operator delete is static and does not have the implicit this pointer, and we cannot use the name this for the variable.

@compnerd compnerd requested a review from rjmccall as a code owner July 25, 2025 03:54
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@swift-ci please smoke test

ASAN identified mismatched `operator new` and `operator delete` on these
types. The reason for this is the sized allocation for the tail packing
involved. Provide the associated `operator delete` that releases the
memory. Note that the `operator delete` is static and does not have the
implicit `this` pointer, and we cannot use the name `this` for the
variable.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

I'm going to merge this - this fixes errors that ASAN identified and I'm hoping it might help uncover other issues so we can find the root cause of the flakiness in building Foundation where we abnormally exit.

@compnerd compnerd merged commit 77d1dc4 into swiftlang:main Jul 27, 2025
3 checks passed
@compnerd compnerd deleted the memories branch July 27, 2025 21:34
@al45tair
Copy link
Contributor

I think this has broken something — my local build is complaining it can't find a matching ::operator delete with the size_t argument, which suggests that sized deallocation isn't enabled on macOS… (which then begs some questions about how this passed PR testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants