Skip to content
Snippets Groups Projects
Commit 43992fe7 authored by Kostya Serebryany's avatar Kostya Serebryany
Browse files

Replace a destructor of EHCleanupScope with a Destroy() method to reflect the current usage.

Summary:
The current code uses memset to re-initialize EHCleanupScope objects
with breaks the assumptions of the upcoming asan's intra-object-overflow checker.
If there is no DTOR, the new checker will refuse to work.

Test Plan: bootstrap with asan

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219331 91177308-0d34-0410-b5e6-96231b3b80d8
parent 3dc3287b
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,7 @@ void EHScopeStack::popCleanup() {
StartOfData += Cleanup.getAllocatedSize();
// Destroy the cleanup.
Cleanup.~EHCleanupScope();
Cleanup.Destroy();
// Check whether we can shrink the branch-fixups stack.
if (!BranchFixups.empty()) {
......
......@@ -280,9 +280,11 @@ public:
assert(CleanupBits.CleanupSize == cleanupSize && "cleanup size overflow");
}
~EHCleanupScope() {
void Destroy() {
delete ExtInfo;
}
// Objects of EHCleanupScope are not destructed. Use Destroy().
~EHCleanupScope() LLVM_DELETED_FUNCTION;
bool isNormalCleanup() const { return CleanupBits.IsNormalCleanup; }
llvm::BasicBlock *getNormalBlock() const { return NormalBlock; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment